diff --git a/vue/README.md b/vue/README.md deleted file mode 100644 index ca99cbb4..00000000 --- a/vue/README.md +++ /dev/null @@ -1,25 +0,0 @@ -## App UI Template - -[Vue.js](https://vuejs.org/)-based web app template for your Cosmos SDK blockchain. Use the template to quickly bootstrap your app. To learn more, check out the components in `@starport/vue` and the [Ignite CLI documentation](https://docs.ignite.com/). - -## Project setup - -``` -npm install -``` - -### Compiles and reloads the app on save for development - -``` -npm run dev -``` - -### Compiles and minifies for production - -``` -npm run build -``` - -### Customize configuration - -See the Vue CLI [Configuration Reference](https://cli.vuejs.org/config/) documentation. diff --git a/vue/index.html b/vue/index.html deleted file mode 100644 index ecaf34c6..00000000 --- a/vue/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - -
- - - diff --git a/vue/package-lock.json b/vue/package-lock.json deleted file mode 100644 index c813e1fe..00000000 --- a/vue/package-lock.json +++ /dev/null @@ -1,3471 +0,0 @@ -{ - "name": "@starport/template", - "version": "0.3.10", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "@starport/template", - "version": "0.3.10", - "dependencies": { - "@cosmjs/launchpad": "0.27.0", - "@cosmjs/proto-signing": "0.27.0", - "@cosmjs/stargate": "0.27.0", - "@starport/vue": "^0.3.10", - "@starport/vuex": "^0.3.10", - "buffer": "^6.0.3", - "core-js": "^3.18.2", - "vue": "^3.2.6", - "vue-router": "^4.0.3", - "vuex": "^4.0.2" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-dynamic-import-vars": "^1.4.1", - "@rollup/plugin-node-resolve": "^13.1.1", - "@vitejs/plugin-vue": "^2.0.1", - "sass": "^1.47.0", - "vite": "^2.7.6", - "vite-plugin-dynamic-import": "^0.1.1", - "vite-plugin-env-compatible": "^1.1.1" - } - }, - "node_modules/@babel/parser": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.8.tgz", - "integrity": "sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw==", - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@confio/ics23": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.5.tgz", - "integrity": "sha512-1GdPMsaP/l8JSF4P4HWFLBhdcxHcJT8lS0nknBYNSZ1XrJOsJKUy6EkOwd9Pa1qJkXzY2gyNv7MdHR+AIwSTAg==", - "dependencies": { - "js-sha512": "^0.8.0", - "protobufjs": "^6.8.8", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "node_modules/@cosmjs/amino": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.0.tgz", - "integrity": "sha512-ybyzRkGrRija1bjGjGP7sAp2ulPA2/S2wMY2pehB7b6ZR8dpwveCjz/IqFWC5KBxz6KZf5MuaONOY+t1kkjsfw==", - "dependencies": { - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/utils": "0.27.0" - } - }, - "node_modules/@cosmjs/crypto": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.0.tgz", - "integrity": "sha512-JTPHINCYZ+mnsxrfv8ZBHsFWgB7EGooa5SD0lQFhkCVX/FC3sqxuFNv6TZU5bVVU71DUSqXTMXF5m9kAMzPUkw==", - "dependencies": { - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/utils": "0.27.0", - "bip39": "^3.0.2", - "bn.js": "^5.2.0", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "node_modules/@cosmjs/crypto/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "node_modules/@cosmjs/encoding": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.27.0.tgz", - "integrity": "sha512-cCT8X/NUAGXOe14F/k2GE6N9btjrOqALBilUPIn5CL4OEGxvRTPD59nWSACu0iafCGz10Tw3LPcouuYPtZmkbg==", - "dependencies": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "node_modules/@cosmjs/json-rpc": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.27.0.tgz", - "integrity": "sha512-Q6na5KPYDD90QhlPZTInquwBycDjvhZvWwpV1TppDd2Em8S1FfN3ePiV2YCf4XzXREU5YPFSHzh5MHK/WhQY3w==", - "dependencies": { - "@cosmjs/stream": "0.27.0", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/launchpad": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.27.0.tgz", - "integrity": "sha512-V8pK3jNvLw/2jf0DK0uD0fN0qUgh+v04NxSNIdRxyn2sdZ8CkD1L+FeKM5mGEn9vreSHOD4Z9pRy2s2roD/tEw==", - "dependencies": { - "@cosmjs/amino": "0.27.0", - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/utils": "0.27.0", - "axios": "^0.21.2", - "fast-deep-equal": "^3.1.3" - } - }, - "node_modules/@cosmjs/math": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.0.tgz", - "integrity": "sha512-+WsrdXojqpUL6l2LKOWYgiAJIDD0faONNtnjb1kpS1btSzZe1Ns+RdygG6QZLLvZuxMfkEzE54ZXDKPD5MhVPA==", - "dependencies": { - "bn.js": "^5.2.0" - } - }, - "node_modules/@cosmjs/math/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "node_modules/@cosmjs/proto-signing": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.27.0.tgz", - "integrity": "sha512-ODqnmY/ElmcEYu6HbDmeGce4KacgzSVGQzvGodZidC1RR9EYociuweBPNwSHqBPolC6PQPI/QGc83m/mbih2xw==", - "dependencies": { - "@cosmjs/amino": "0.27.0", - "@cosmjs/crypto": "0.27.0", - "@cosmjs/math": "0.27.0", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2" - } - }, - "node_modules/@cosmjs/socket": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.27.0.tgz", - "integrity": "sha512-lOd0s6gLyjdjcs8xnYuS2IXRqBLUrI76Bek5wsia+m5CyUvHjRbbd7+nZiznbtVjApBlIwHGkiklLg3/byxkAA==", - "dependencies": { - "@cosmjs/stream": "0.27.0", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stargate": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.27.0.tgz", - "integrity": "sha512-Fiqk8rIpB4emzC/P7/+ZPPJV9aG6KJhVuOF4D8c1j1Bv8fVs1XqC6NgsY6elTLXl38pgXt7REn6VYzAdZwrHXQ==", - "dependencies": { - "@confio/ics23": "^0.6.3", - "@cosmjs/amino": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/proto-signing": "0.27.0", - "@cosmjs/stream": "0.27.0", - "@cosmjs/tendermint-rpc": "0.27.0", - "@cosmjs/utils": "0.27.0", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stream": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.27.0.tgz", - "integrity": "sha512-D9mXHqS6y7xrThhUg5SCvMjiVQ8ph9f7gAuWlrXhqVJ5FqrP6OyTGRbVyGGM91d5Jj7N7oidQ+hOfc34vKFgeg==", - "dependencies": { - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/tendermint-rpc": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.27.0.tgz", - "integrity": "sha512-WFcJ2/UF76fBBVzPRiHJoC/GCKvgt0mb7+ewgpwKBeEcYwfj5qb1QreGBbHn/UZx9QSsF9jhI5k7SmNdglC3cA==", - "dependencies": { - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/json-rpc": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/socket": "0.27.0", - "@cosmjs/stream": "0.27.0", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/utils": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.0.tgz", - "integrity": "sha512-UC1eWY9isDQm6POy6GaTmYtbPVY5dkywdjW8Qzj+JNMhbhMM0KHuI4pHwjv5TPXSO/Ba2z10MTnD9nUlZtDwtA==" - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "node_modules/@rollup/plugin-commonjs": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz", - "integrity": "sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^2.38.3" - } - }, - "node_modules/@rollup/plugin-dynamic-import-vars": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-dynamic-import-vars/-/plugin-dynamic-import-vars-1.4.2.tgz", - "integrity": "sha512-SEaS9Pf0RyaZ/oJ1knLZT+Fu0X6DlyTfUcoE7XKkiKJjNaB+8SLoHmDVRhomo5RpWHPyd+B00G/bE5R5+Q+HEg==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^4.1.2", - "estree-walker": "^2.0.1", - "fast-glob": "^3.2.7", - "magic-string": "^0.25.7" - }, - "engines": { - "node": ">= 10.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" - } - }, - "node_modules/@rollup/plugin-dynamic-import-vars/node_modules/@rollup/pluginutils": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz", - "integrity": "sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==", - "dev": true, - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "13.1.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz", - "integrity": "sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.19.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "peerDependencies": { - "rollup": "^2.42.0" - } - }, - "node_modules/@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "dependencies": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" - } - }, - "node_modules/@rollup/pluginutils/node_modules/estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - }, - "node_modules/@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "node_modules/@types/long": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", - "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" - }, - "node_modules/@types/node": { - "version": "17.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.8.tgz", - "integrity": "sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg==" - }, - "node_modules/@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@vitejs/plugin-vue": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-2.0.1.tgz", - "integrity": "sha512-wtdMnGVvys9K8tg+DxowU1ytTrdVveXr3LzdhaKakysgGXyrsfaeds2cDywtvujEASjWOwWL/OgWM+qoeM8Plg==", - "dev": true, - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "vite": "^2.5.10", - "vue": "^3.2.25" - } - }, - "node_modules/@vue/compiler-core": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.26.tgz", - "integrity": "sha512-N5XNBobZbaASdzY9Lga2D9Lul5vdCIOXvUMd6ThcN8zgqQhPKfCV+wfAJNNJKQkSHudnYRO2gEB+lp0iN3g2Tw==", - "dependencies": { - "@babel/parser": "^7.16.4", - "@vue/shared": "3.2.26", - "estree-walker": "^2.0.2", - "source-map": "^0.6.1" - } - }, - "node_modules/@vue/compiler-dom": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.26.tgz", - "integrity": "sha512-smBfaOW6mQDxcT3p9TKT6mE22vjxjJL50GFVJiI0chXYGU/xzC05QRGrW3HHVuJrmLTLx5zBhsZ2dIATERbarg==", - "dependencies": { - "@vue/compiler-core": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "node_modules/@vue/compiler-sfc": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.26.tgz", - "integrity": "sha512-ePpnfktV90UcLdsDQUh2JdiTuhV0Skv2iYXxfNMOK/F3Q+2BO0AulcVcfoksOpTJGmhhfosWfMyEaEf0UaWpIw==", - "dependencies": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.26", - "@vue/compiler-dom": "3.2.26", - "@vue/compiler-ssr": "3.2.26", - "@vue/reactivity-transform": "3.2.26", - "@vue/shared": "3.2.26", - "estree-walker": "^2.0.2", - "magic-string": "^0.25.7", - "postcss": "^8.1.10", - "source-map": "^0.6.1" - } - }, - "node_modules/@vue/compiler-ssr": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.26.tgz", - "integrity": "sha512-2mywLX0ODc4Zn8qBoA2PDCsLEZfpUGZcyoFRLSOjyGGK6wDy2/5kyDOWtf0S0UvtoyVq95OTSGIALjZ4k2q/ag==", - "dependencies": { - "@vue/compiler-dom": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "node_modules/@vue/devtools-api": { - "version": "6.0.0-beta.21.1", - "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.0.0-beta.21.1.tgz", - "integrity": "sha512-FqC4s3pm35qGVeXRGOjTsRzlkJjrBLriDS9YXbflHLsfA9FrcKzIyWnLXoNm+/7930E8rRakXuAc2QkC50swAw==" - }, - "node_modules/@vue/reactivity": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.26.tgz", - "integrity": "sha512-h38bxCZLW6oFJVDlCcAiUKFnXI8xP8d+eO0pcDxx+7dQfSPje2AO6M9S9QO6MrxQB7fGP0DH0dYQ8ksf6hrXKQ==", - "dependencies": { - "@vue/shared": "3.2.26" - } - }, - "node_modules/@vue/reactivity-transform": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.26.tgz", - "integrity": "sha512-XKMyuCmzNA7nvFlYhdKwD78rcnmPb7q46uoR00zkX6yZrUmcCQ5OikiwUEVbvNhL5hBJuvbSO95jB5zkUon+eQ==", - "dependencies": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.26", - "@vue/shared": "3.2.26", - "estree-walker": "^2.0.2", - "magic-string": "^0.25.7" - } - }, - "node_modules/@vue/runtime-core": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.26.tgz", - "integrity": "sha512-BcYi7qZ9Nn+CJDJrHQ6Zsmxei2hDW0L6AB4vPvUQGBm2fZyC0GXd/4nVbyA2ubmuhctD5RbYY8L+5GUJszv9mQ==", - "dependencies": { - "@vue/reactivity": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "node_modules/@vue/runtime-dom": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.26.tgz", - "integrity": "sha512-dY56UIiZI+gjc4e8JQBwAifljyexfVCkIAu/WX8snh8vSOt/gMSEGwPRcl2UpYpBYeyExV8WCbgvwWRNt9cHhQ==", - "dependencies": { - "@vue/runtime-core": "3.2.26", - "@vue/shared": "3.2.26", - "csstype": "^2.6.8" - } - }, - "node_modules/@vue/server-renderer": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.26.tgz", - "integrity": "sha512-Jp5SggDUvvUYSBIvYEhy76t4nr1vapY/FIFloWmQzn7UxqaHrrBpbxrqPcTrSgGrcaglj0VBp22BKJNre4aA1w==", - "dependencies": { - "@vue/compiler-ssr": "3.2.26", - "@vue/shared": "3.2.26" - }, - "peerDependencies": { - "vue": "3.2.26" - } - }, - "node_modules/@vue/shared": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.26.tgz", - "integrity": "sha512-vPV6Cq+NIWbH5pZu+V+2QHE9y1qfuTq49uNWw4f7FDEeZaDU2H2cx5jcUZOAKW7qTrUS4k6qZPbMy1x4N96nbA==" - }, - "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/bip39": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz", - "integrity": "sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw==", - "dependencies": { - "@types/node": "11.11.6", - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1" - } - }, - "node_modules/bip39/node_modules/@types/node": { - "version": "11.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", - "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" - }, - "node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "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/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/builtin-modules": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", - "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", - "dev": true, - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/core-js": { - "version": "3.20.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.2.tgz", - "integrity": "sha512-nuqhq11DcOAbFBV4zCbKeGbKQsUDRqTX0oqx7AttUBuqe3h20ixsE039QHelbL6P4h+9kytVqyEtyZ6gsiwEYw==", - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/cosmjs-types": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz", - "integrity": "sha512-I7E/cHkIgoJzMNQdFF0YVqPlaTqrqKHrskuSTIqlEyxfB5Lf3WKCajSXVK2yHOfOFfSux/RxEdpMzw/eO4DIog==", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/cosmjs-types/node_modules/protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/csstype": { - "version": "2.6.19", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.19.tgz", - "integrity": "sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==" - }, - "node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dependencies": { - "object-keys": "^1.0.12" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/esbuild": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.13.15.tgz", - "integrity": "sha512-raCxt02HBKv8RJxE8vkTSCXGIyKHdEdGfUmiYb8wnabnaEmHzyW7DCHb5tEN0xU8ryqg5xw54mcwnYkC4x3AIw==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "optionalDependencies": { - "esbuild-android-arm64": "0.13.15", - "esbuild-darwin-64": "0.13.15", - "esbuild-darwin-arm64": "0.13.15", - "esbuild-freebsd-64": "0.13.15", - "esbuild-freebsd-arm64": "0.13.15", - "esbuild-linux-32": "0.13.15", - "esbuild-linux-64": "0.13.15", - "esbuild-linux-arm": "0.13.15", - "esbuild-linux-arm64": "0.13.15", - "esbuild-linux-mips64le": "0.13.15", - "esbuild-linux-ppc64le": "0.13.15", - "esbuild-netbsd-64": "0.13.15", - "esbuild-openbsd-64": "0.13.15", - "esbuild-sunos-64": "0.13.15", - "esbuild-windows-32": "0.13.15", - "esbuild-windows-64": "0.13.15", - "esbuild-windows-arm64": "0.13.15" - } - }, - "node_modules/esbuild-android-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz", - "integrity": "sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/esbuild-darwin-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.15.tgz", - "integrity": "sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/esbuild-darwin-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.15.tgz", - "integrity": "sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/esbuild-freebsd-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.15.tgz", - "integrity": "sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/esbuild-freebsd-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.15.tgz", - "integrity": "sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/esbuild-linux-32": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.15.tgz", - "integrity": "sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/esbuild-linux-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.15.tgz", - "integrity": "sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/esbuild-linux-arm": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.15.tgz", - "integrity": "sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/esbuild-linux-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.15.tgz", - "integrity": "sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/esbuild-linux-mips64le": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.15.tgz", - "integrity": "sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/esbuild-linux-ppc64le": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.15.tgz", - "integrity": "sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/esbuild-netbsd-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.15.tgz", - "integrity": "sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ] - }, - "node_modules/esbuild-openbsd-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.15.tgz", - "integrity": "sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ] - }, - "node_modules/esbuild-sunos-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.15.tgz", - "integrity": "sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ] - }, - "node_modules/esbuild-windows-32": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.15.tgz", - "integrity": "sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/esbuild-windows-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.15.tgz", - "integrity": "sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/esbuild-windows-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz", - "integrity": "sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-glob": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.10.tgz", - "integrity": "sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/follow-redirects": { - "version": "1.14.7", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", - "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globalthis": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.2.tgz", - "integrity": "sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ==", - "dependencies": { - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/immutable": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz", - "integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==", - "dev": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", - "dev": true - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", - "peerDependencies": { - "ws": "*" - } - }, - "node_modules/js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" - }, - "node_modules/js-sha512": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz", - "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==" - }, - "node_modules/libsodium": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.9.tgz", - "integrity": "sha512-gfeADtR4D/CM0oRUviKBViMGXZDgnFdMKMzHsvBdqLBHd9ySi6EtYnmuhHVDDYgYpAO8eU8hEY+F8vIUAPh08A==" - }, - "node_modules/libsodium-wrappers": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz", - "integrity": "sha512-9HaAeBGk1nKTRFRHkt7nzxqCvnkWTjn1pdjKgcUnZxj0FyOP4CnhgFhMdrFfgNsukijBGyBLpP2m2uKT1vuWhQ==", - "dependencies": { - "libsodium": "^0.7.0" - } - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "node_modules/magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dependencies": { - "sourcemap-codec": "^1.4.4" - } - }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/nanoid": { - "version": "3.1.32", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.32.tgz", - "integrity": "sha512-F8mf7R3iT9bvThBoW4tGXhXFHCctyCiUUPrWF8WaTqa3h96d9QybkSeba43XVOOE3oiLfkVDe4bT8MeGmkrTxw==", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postcss": { - "version": "8.4.5", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.5.tgz", - "integrity": "sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==", - "dependencies": { - "nanoid": "^3.1.30", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - } - }, - "node_modules/protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/protobufjs/node_modules/@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/readonly-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", - "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==" - }, - "node_modules/resolve": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.0.tgz", - "integrity": "sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==", - "dev": true, - "dependencies": { - "is-core-module": "^2.8.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/rollup": { - "version": "2.64.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.64.0.tgz", - "integrity": "sha512-+c+lbw1lexBKSMb1yxGDVfJ+vchJH3qLbmavR+awDinTDA2C5Ug9u7lkOzj62SCu0PKUExsW36tpgW7Fmpn3yQ==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/sass": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.48.0.tgz", - "integrity": "sha512-hQi5g4DcfjcipotoHZ80l7GNJHGqQS5LwMBjVYB/TaT0vcSSpbgM8Ad7cgfsB2M0MinbkEQQPO9+sjjSiwxqmw==", - "dev": true, - "dependencies": { - "chokidar": ">=3.0.0 <4.0.0", - "immutable": "^4.0.0", - "source-map-js": ">=0.6.2 <2.0.0" - }, - "bin": { - "sass": "sass.js" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.1.tgz", - "integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/symbol-observable": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", - "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==", - "engines": { - "node": ">=0.10" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "node_modules/vite": { - "version": "2.7.12", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.7.12.tgz", - "integrity": "sha512-KvPYToRQWhRfBeVkyhkZ5hASuHQkqZUUdUcE3xyYtq5oYEPIJ0h9LWiWTO6v990glmSac2cEPeYeXzpX5Z6qKQ==", - "dev": true, - "dependencies": { - "esbuild": "^0.13.12", - "postcss": "^8.4.5", - "resolve": "^1.20.0", - "rollup": "^2.59.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": ">=12.2.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - }, - "peerDependencies": { - "less": "*", - "sass": "*", - "stylus": "*" - }, - "peerDependenciesMeta": { - "less": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - } - } - }, - "node_modules/vite-plugin-dynamic-import": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/vite-plugin-dynamic-import/-/vite-plugin-dynamic-import-0.1.1.tgz", - "integrity": "sha512-lk45O94+qgMbkwagBrnlPPGZ7OxmlEQBksHqdLim5NjzaR/fbFsIXf8jqZeYaeU3tKQzxnUtxHFYhJGfZQ3Hzw==", - "dev": true, - "dependencies": { - "acorn": "^8.5.0", - "acorn-walk": "^8.2.0", - "glob": "^7.1.7" - } - }, - "node_modules/vite-plugin-env-compatible": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vite-plugin-env-compatible/-/vite-plugin-env-compatible-1.1.1.tgz", - "integrity": "sha512-4lqhBWhOzP+SaCPoCVdmpM5cXzjKQV5jgFauxea488oOeElXo/kw6bXkMIooZhrh9q7gclTl8en6N9NmnqUwRQ==", - "dev": true - }, - "node_modules/vue": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.26.tgz", - "integrity": "sha512-KD4lULmskL5cCsEkfhERVRIOEDrfEL9CwAsLYpzptOGjaGFNWo3BQ9g8MAb7RaIO71rmVOziZ/uEN/rHwcUIhg==", - "dependencies": { - "@vue/compiler-dom": "3.2.26", - "@vue/compiler-sfc": "3.2.26", - "@vue/runtime-dom": "3.2.26", - "@vue/server-renderer": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "node_modules/vue-router": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.12.tgz", - "integrity": "sha512-CPXvfqe+mZLB1kBWssssTiWg4EQERyqJZes7USiqfW9B5N2x+nHlnsM1D3b5CaJ6qgCvMmYJnz+G0iWjNCvXrg==", - "dependencies": { - "@vue/devtools-api": "^6.0.0-beta.18" - }, - "peerDependencies": { - "vue": "^3.0.0" - } - }, - "node_modules/vuex": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/vuex/-/vuex-4.0.2.tgz", - "integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==", - "dependencies": { - "@vue/devtools-api": "^6.0.0-beta.11" - }, - "peerDependencies": { - "vue": "^3.0.2" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/ws": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", - "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xstream": { - "version": "11.14.0", - "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", - "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", - "dependencies": { - "globalthis": "^1.0.1", - "symbol-observable": "^2.0.3" - } - } - }, - "dependencies": { - "@babel/parser": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.8.tgz", - "integrity": "sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw==" - }, - "@confio/ics23": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.5.tgz", - "integrity": "sha512-1GdPMsaP/l8JSF4P4HWFLBhdcxHcJT8lS0nknBYNSZ1XrJOsJKUy6EkOwd9Pa1qJkXzY2gyNv7MdHR+AIwSTAg==", - "requires": { - "js-sha512": "^0.8.0", - "protobufjs": "^6.8.8", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "@cosmjs/amino": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.0.tgz", - "integrity": "sha512-ybyzRkGrRija1bjGjGP7sAp2ulPA2/S2wMY2pehB7b6ZR8dpwveCjz/IqFWC5KBxz6KZf5MuaONOY+t1kkjsfw==", - "requires": { - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/utils": "0.27.0" - } - }, - "@cosmjs/crypto": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.0.tgz", - "integrity": "sha512-JTPHINCYZ+mnsxrfv8ZBHsFWgB7EGooa5SD0lQFhkCVX/FC3sqxuFNv6TZU5bVVU71DUSqXTMXF5m9kAMzPUkw==", - "requires": { - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/utils": "0.27.0", - "bip39": "^3.0.2", - "bn.js": "^5.2.0", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - } - } - }, - "@cosmjs/encoding": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.27.0.tgz", - "integrity": "sha512-cCT8X/NUAGXOe14F/k2GE6N9btjrOqALBilUPIn5CL4OEGxvRTPD59nWSACu0iafCGz10Tw3LPcouuYPtZmkbg==", - "requires": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "@cosmjs/json-rpc": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.27.0.tgz", - "integrity": "sha512-Q6na5KPYDD90QhlPZTInquwBycDjvhZvWwpV1TppDd2Em8S1FfN3ePiV2YCf4XzXREU5YPFSHzh5MHK/WhQY3w==", - "requires": { - "@cosmjs/stream": "0.27.0", - "xstream": "^11.14.0" - } - }, - "@cosmjs/launchpad": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.27.0.tgz", - "integrity": "sha512-V8pK3jNvLw/2jf0DK0uD0fN0qUgh+v04NxSNIdRxyn2sdZ8CkD1L+FeKM5mGEn9vreSHOD4Z9pRy2s2roD/tEw==", - "requires": { - "@cosmjs/amino": "0.27.0", - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/utils": "0.27.0", - "axios": "^0.21.2", - "fast-deep-equal": "^3.1.3" - } - }, - "@cosmjs/math": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.0.tgz", - "integrity": "sha512-+WsrdXojqpUL6l2LKOWYgiAJIDD0faONNtnjb1kpS1btSzZe1Ns+RdygG6QZLLvZuxMfkEzE54ZXDKPD5MhVPA==", - "requires": { - "bn.js": "^5.2.0" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - } - } - }, - "@cosmjs/proto-signing": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.27.0.tgz", - "integrity": "sha512-ODqnmY/ElmcEYu6HbDmeGce4KacgzSVGQzvGodZidC1RR9EYociuweBPNwSHqBPolC6PQPI/QGc83m/mbih2xw==", - "requires": { - "@cosmjs/amino": "0.27.0", - "@cosmjs/crypto": "0.27.0", - "@cosmjs/math": "0.27.0", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2" - } - }, - "@cosmjs/socket": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.27.0.tgz", - "integrity": "sha512-lOd0s6gLyjdjcs8xnYuS2IXRqBLUrI76Bek5wsia+m5CyUvHjRbbd7+nZiznbtVjApBlIwHGkiklLg3/byxkAA==", - "requires": { - "@cosmjs/stream": "0.27.0", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stargate": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.27.0.tgz", - "integrity": "sha512-Fiqk8rIpB4emzC/P7/+ZPPJV9aG6KJhVuOF4D8c1j1Bv8fVs1XqC6NgsY6elTLXl38pgXt7REn6VYzAdZwrHXQ==", - "requires": { - "@confio/ics23": "^0.6.3", - "@cosmjs/amino": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/proto-signing": "0.27.0", - "@cosmjs/stream": "0.27.0", - "@cosmjs/tendermint-rpc": "0.27.0", - "@cosmjs/utils": "0.27.0", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stream": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.27.0.tgz", - "integrity": "sha512-D9mXHqS6y7xrThhUg5SCvMjiVQ8ph9f7gAuWlrXhqVJ5FqrP6OyTGRbVyGGM91d5Jj7N7oidQ+hOfc34vKFgeg==", - "requires": { - "xstream": "^11.14.0" - } - }, - "@cosmjs/tendermint-rpc": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.27.0.tgz", - "integrity": "sha512-WFcJ2/UF76fBBVzPRiHJoC/GCKvgt0mb7+ewgpwKBeEcYwfj5qb1QreGBbHn/UZx9QSsF9jhI5k7SmNdglC3cA==", - "requires": { - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/json-rpc": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/socket": "0.27.0", - "@cosmjs/stream": "0.27.0", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "@cosmjs/utils": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.0.tgz", - "integrity": "sha512-UC1eWY9isDQm6POy6GaTmYtbPVY5dkywdjW8Qzj+JNMhbhMM0KHuI4pHwjv5TPXSO/Ba2z10MTnD9nUlZtDwtA==" - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "@rollup/plugin-commonjs": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz", - "integrity": "sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - } - }, - "@rollup/plugin-dynamic-import-vars": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-dynamic-import-vars/-/plugin-dynamic-import-vars-1.4.2.tgz", - "integrity": "sha512-SEaS9Pf0RyaZ/oJ1knLZT+Fu0X6DlyTfUcoE7XKkiKJjNaB+8SLoHmDVRhomo5RpWHPyd+B00G/bE5R5+Q+HEg==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^4.1.2", - "estree-walker": "^2.0.1", - "fast-glob": "^3.2.7", - "magic-string": "^0.25.7" - }, - "dependencies": { - "@rollup/pluginutils": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz", - "integrity": "sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==", - "dev": true, - "requires": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - } - } - } - }, - "@rollup/plugin-node-resolve": { - "version": "13.1.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz", - "integrity": "sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.19.0" - } - }, - "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "dependencies": { - "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - } - } - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "@types/long": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", - "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" - }, - "@types/node": { - "version": "17.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.8.tgz", - "integrity": "sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg==" - }, - "@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@vitejs/plugin-vue": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-2.0.1.tgz", - "integrity": "sha512-wtdMnGVvys9K8tg+DxowU1ytTrdVveXr3LzdhaKakysgGXyrsfaeds2cDywtvujEASjWOwWL/OgWM+qoeM8Plg==", - "dev": true, - "requires": {} - }, - "@vue/compiler-core": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.26.tgz", - "integrity": "sha512-N5XNBobZbaASdzY9Lga2D9Lul5vdCIOXvUMd6ThcN8zgqQhPKfCV+wfAJNNJKQkSHudnYRO2gEB+lp0iN3g2Tw==", - "requires": { - "@babel/parser": "^7.16.4", - "@vue/shared": "3.2.26", - "estree-walker": "^2.0.2", - "source-map": "^0.6.1" - } - }, - "@vue/compiler-dom": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.26.tgz", - "integrity": "sha512-smBfaOW6mQDxcT3p9TKT6mE22vjxjJL50GFVJiI0chXYGU/xzC05QRGrW3HHVuJrmLTLx5zBhsZ2dIATERbarg==", - "requires": { - "@vue/compiler-core": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "@vue/compiler-sfc": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.26.tgz", - "integrity": "sha512-ePpnfktV90UcLdsDQUh2JdiTuhV0Skv2iYXxfNMOK/F3Q+2BO0AulcVcfoksOpTJGmhhfosWfMyEaEf0UaWpIw==", - "requires": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.26", - "@vue/compiler-dom": "3.2.26", - "@vue/compiler-ssr": "3.2.26", - "@vue/reactivity-transform": "3.2.26", - "@vue/shared": "3.2.26", - "estree-walker": "^2.0.2", - "magic-string": "^0.25.7", - "postcss": "^8.1.10", - "source-map": "^0.6.1" - } - }, - "@vue/compiler-ssr": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.26.tgz", - "integrity": "sha512-2mywLX0ODc4Zn8qBoA2PDCsLEZfpUGZcyoFRLSOjyGGK6wDy2/5kyDOWtf0S0UvtoyVq95OTSGIALjZ4k2q/ag==", - "requires": { - "@vue/compiler-dom": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "@vue/devtools-api": { - "version": "6.0.0-beta.21.1", - "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.0.0-beta.21.1.tgz", - "integrity": "sha512-FqC4s3pm35qGVeXRGOjTsRzlkJjrBLriDS9YXbflHLsfA9FrcKzIyWnLXoNm+/7930E8rRakXuAc2QkC50swAw==" - }, - "@vue/reactivity": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.26.tgz", - "integrity": "sha512-h38bxCZLW6oFJVDlCcAiUKFnXI8xP8d+eO0pcDxx+7dQfSPje2AO6M9S9QO6MrxQB7fGP0DH0dYQ8ksf6hrXKQ==", - "requires": { - "@vue/shared": "3.2.26" - } - }, - "@vue/reactivity-transform": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.26.tgz", - "integrity": "sha512-XKMyuCmzNA7nvFlYhdKwD78rcnmPb7q46uoR00zkX6yZrUmcCQ5OikiwUEVbvNhL5hBJuvbSO95jB5zkUon+eQ==", - "requires": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.26", - "@vue/shared": "3.2.26", - "estree-walker": "^2.0.2", - "magic-string": "^0.25.7" - } - }, - "@vue/runtime-core": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.26.tgz", - "integrity": "sha512-BcYi7qZ9Nn+CJDJrHQ6Zsmxei2hDW0L6AB4vPvUQGBm2fZyC0GXd/4nVbyA2ubmuhctD5RbYY8L+5GUJszv9mQ==", - "requires": { - "@vue/reactivity": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "@vue/runtime-dom": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.26.tgz", - "integrity": "sha512-dY56UIiZI+gjc4e8JQBwAifljyexfVCkIAu/WX8snh8vSOt/gMSEGwPRcl2UpYpBYeyExV8WCbgvwWRNt9cHhQ==", - "requires": { - "@vue/runtime-core": "3.2.26", - "@vue/shared": "3.2.26", - "csstype": "^2.6.8" - } - }, - "@vue/server-renderer": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.26.tgz", - "integrity": "sha512-Jp5SggDUvvUYSBIvYEhy76t4nr1vapY/FIFloWmQzn7UxqaHrrBpbxrqPcTrSgGrcaglj0VBp22BKJNre4aA1w==", - "requires": { - "@vue/compiler-ssr": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "@vue/shared": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.26.tgz", - "integrity": "sha512-vPV6Cq+NIWbH5pZu+V+2QHE9y1qfuTq49uNWw4f7FDEeZaDU2H2cx5jcUZOAKW7qTrUS4k6qZPbMy1x4N96nbA==" - }, - "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true - }, - "acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true - }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "bip39": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz", - "integrity": "sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw==", - "requires": { - "@types/node": "11.11.6", - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1" - }, - "dependencies": { - "@types/node": { - "version": "11.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", - "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" - } - } - }, - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, - "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "builtin-modules": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", - "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", - "dev": true - }, - "chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "core-js": { - "version": "3.20.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.2.tgz", - "integrity": "sha512-nuqhq11DcOAbFBV4zCbKeGbKQsUDRqTX0oqx7AttUBuqe3h20ixsE039QHelbL6P4h+9kytVqyEtyZ6gsiwEYw==" - }, - "cosmjs-types": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz", - "integrity": "sha512-I7E/cHkIgoJzMNQdFF0YVqPlaTqrqKHrskuSTIqlEyxfB5Lf3WKCajSXVK2yHOfOFfSux/RxEdpMzw/eO4DIog==", - "requires": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - }, - "dependencies": { - "protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", - "requires": { - "@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/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - } - } - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "csstype": { - "version": "2.6.19", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.19.tgz", - "integrity": "sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==" - }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - } - }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "esbuild": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.13.15.tgz", - "integrity": "sha512-raCxt02HBKv8RJxE8vkTSCXGIyKHdEdGfUmiYb8wnabnaEmHzyW7DCHb5tEN0xU8ryqg5xw54mcwnYkC4x3AIw==", - "dev": true, - "requires": { - "esbuild-android-arm64": "0.13.15", - "esbuild-darwin-64": "0.13.15", - "esbuild-darwin-arm64": "0.13.15", - "esbuild-freebsd-64": "0.13.15", - "esbuild-freebsd-arm64": "0.13.15", - "esbuild-linux-32": "0.13.15", - "esbuild-linux-64": "0.13.15", - "esbuild-linux-arm": "0.13.15", - "esbuild-linux-arm64": "0.13.15", - "esbuild-linux-mips64le": "0.13.15", - "esbuild-linux-ppc64le": "0.13.15", - "esbuild-netbsd-64": "0.13.15", - "esbuild-openbsd-64": "0.13.15", - "esbuild-sunos-64": "0.13.15", - "esbuild-windows-32": "0.13.15", - "esbuild-windows-64": "0.13.15", - "esbuild-windows-arm64": "0.13.15" - } - }, - "esbuild-android-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz", - "integrity": "sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg==", - "dev": true, - "optional": true - }, - "esbuild-darwin-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.15.tgz", - "integrity": "sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ==", - "dev": true, - "optional": true - }, - "esbuild-darwin-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.15.tgz", - "integrity": "sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.15.tgz", - "integrity": "sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.15.tgz", - "integrity": "sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ==", - "dev": true, - "optional": true - }, - "esbuild-linux-32": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.15.tgz", - "integrity": "sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g==", - "dev": true, - "optional": true - }, - "esbuild-linux-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.15.tgz", - "integrity": "sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.15.tgz", - "integrity": "sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.15.tgz", - "integrity": "sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA==", - "dev": true, - "optional": true - }, - "esbuild-linux-mips64le": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.15.tgz", - "integrity": "sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg==", - "dev": true, - "optional": true - }, - "esbuild-linux-ppc64le": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.15.tgz", - "integrity": "sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ==", - "dev": true, - "optional": true - }, - "esbuild-netbsd-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.15.tgz", - "integrity": "sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w==", - "dev": true, - "optional": true - }, - "esbuild-openbsd-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.15.tgz", - "integrity": "sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g==", - "dev": true, - "optional": true - }, - "esbuild-sunos-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.15.tgz", - "integrity": "sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw==", - "dev": true, - "optional": true - }, - "esbuild-windows-32": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.15.tgz", - "integrity": "sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw==", - "dev": true, - "optional": true - }, - "esbuild-windows-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.15.tgz", - "integrity": "sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ==", - "dev": true, - "optional": true - }, - "esbuild-windows-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz", - "integrity": "sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA==", - "dev": true, - "optional": true - }, - "estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-glob": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.10.tgz", - "integrity": "sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "follow-redirects": { - "version": "1.14.7", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", - "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globalthis": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.2.tgz", - "integrity": "sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ==", - "requires": { - "define-properties": "^1.1.3" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "immutable": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz", - "integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", - "dev": true - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "requires": { - "@types/estree": "*" - } - }, - "isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", - "requires": {} - }, - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" - }, - "js-sha512": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz", - "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==" - }, - "libsodium": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.9.tgz", - "integrity": "sha512-gfeADtR4D/CM0oRUviKBViMGXZDgnFdMKMzHsvBdqLBHd9ySi6EtYnmuhHVDDYgYpAO8eU8hEY+F8vIUAPh08A==" - }, - "libsodium-wrappers": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz", - "integrity": "sha512-9HaAeBGk1nKTRFRHkt7nzxqCvnkWTjn1pdjKgcUnZxj0FyOP4CnhgFhMdrFfgNsukijBGyBLpP2m2uKT1vuWhQ==", - "requires": { - "libsodium": "^0.7.0" - } - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "nanoid": { - "version": "3.1.32", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.32.tgz", - "integrity": "sha512-F8mf7R3iT9bvThBoW4tGXhXFHCctyCiUUPrWF8WaTqa3h96d9QybkSeba43XVOOE3oiLfkVDe4bT8MeGmkrTxw==" - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "postcss": { - "version": "8.4.5", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.5.tgz", - "integrity": "sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==", - "requires": { - "nanoid": "^3.1.30", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.1" - } - }, - "protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", - "requires": { - "@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/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" - }, - "dependencies": { - "@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" - } - } - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "readonly-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", - "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==" - }, - "resolve": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.0.tgz", - "integrity": "sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==", - "dev": true, - "requires": { - "is-core-module": "^2.8.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rollup": { - "version": "2.64.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.64.0.tgz", - "integrity": "sha512-+c+lbw1lexBKSMb1yxGDVfJ+vchJH3qLbmavR+awDinTDA2C5Ug9u7lkOzj62SCu0PKUExsW36tpgW7Fmpn3yQ==", - "dev": true, - "requires": { - "fsevents": "~2.3.2" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "sass": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.48.0.tgz", - "integrity": "sha512-hQi5g4DcfjcipotoHZ80l7GNJHGqQS5LwMBjVYB/TaT0vcSSpbgM8Ad7cgfsB2M0MinbkEQQPO9+sjjSiwxqmw==", - "dev": true, - "requires": { - "chokidar": ">=3.0.0 <4.0.0", - "immutable": "^4.0.0", - "source-map-js": ">=0.6.2 <2.0.0" - } - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, - "source-map-js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.1.tgz", - "integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==" - }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true - }, - "symbol-observable": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", - "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==" - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "vite": { - "version": "2.7.12", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.7.12.tgz", - "integrity": "sha512-KvPYToRQWhRfBeVkyhkZ5hASuHQkqZUUdUcE3xyYtq5oYEPIJ0h9LWiWTO6v990glmSac2cEPeYeXzpX5Z6qKQ==", - "dev": true, - "requires": { - "esbuild": "^0.13.12", - "fsevents": "~2.3.2", - "postcss": "^8.4.5", - "resolve": "^1.20.0", - "rollup": "^2.59.0" - } - }, - "vite-plugin-dynamic-import": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/vite-plugin-dynamic-import/-/vite-plugin-dynamic-import-0.1.1.tgz", - "integrity": "sha512-lk45O94+qgMbkwagBrnlPPGZ7OxmlEQBksHqdLim5NjzaR/fbFsIXf8jqZeYaeU3tKQzxnUtxHFYhJGfZQ3Hzw==", - "dev": true, - "requires": { - "acorn": "^8.5.0", - "acorn-walk": "^8.2.0", - "glob": "^7.1.7" - } - }, - "vite-plugin-env-compatible": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vite-plugin-env-compatible/-/vite-plugin-env-compatible-1.1.1.tgz", - "integrity": "sha512-4lqhBWhOzP+SaCPoCVdmpM5cXzjKQV5jgFauxea488oOeElXo/kw6bXkMIooZhrh9q7gclTl8en6N9NmnqUwRQ==", - "dev": true - }, - "vue": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.26.tgz", - "integrity": "sha512-KD4lULmskL5cCsEkfhERVRIOEDrfEL9CwAsLYpzptOGjaGFNWo3BQ9g8MAb7RaIO71rmVOziZ/uEN/rHwcUIhg==", - "requires": { - "@vue/compiler-dom": "3.2.26", - "@vue/compiler-sfc": "3.2.26", - "@vue/runtime-dom": "3.2.26", - "@vue/server-renderer": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "vue-router": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.12.tgz", - "integrity": "sha512-CPXvfqe+mZLB1kBWssssTiWg4EQERyqJZes7USiqfW9B5N2x+nHlnsM1D3b5CaJ6qgCvMmYJnz+G0iWjNCvXrg==", - "requires": { - "@vue/devtools-api": "^6.0.0-beta.18" - } - }, - "vuex": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/vuex/-/vuex-4.0.2.tgz", - "integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==", - "requires": { - "@vue/devtools-api": "^6.0.0-beta.11" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "ws": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", - "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", - "requires": {} - }, - "xstream": { - "version": "11.14.0", - "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", - "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", - "requires": { - "globalthis": "^1.0.1", - "symbol-observable": "^2.0.3" - } - } - } -} diff --git a/vue/package.json b/vue/package.json deleted file mode 100644 index 97355bf9..00000000 --- a/vue/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "author": "Tendermint, Inc ", - "dependencies": { - "@cosmjs/launchpad": "0.27.0", - "@cosmjs/proto-signing": "0.27.0", - "@cosmjs/stargate": "0.27.0", - "@starport/vue": "^0.3.10", - "@starport/vuex": "^0.3.10", - "buffer": "^6.0.3", - "core-js": "^3.18.2", - "fairyring-client-ts": "file:../ts-client", - "vue": "^3.2.6", - "vue-router": "^4.0.3", - "vuex": "^4.0.2" - }, - "description": "A Vue 3 boilerplate project utilizing @starport/vue and @starport/vuex", - "devDependencies": { - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-dynamic-import-vars": "^1.4.1", - "@rollup/plugin-node-resolve": "^13.1.1", - "@vitejs/plugin-vue": "^2.0.1", - "sass": "^1.47.0", - "vite": "^2.7.6", - "vite-plugin-dynamic-import": "^0.1.1", - "vite-plugin-env-compatible": "^1.1.1" - }, - "name": "@starport/template", - "private": true, - "scripts": { - "build": "vite build", - "dev": "vite", - "postinstall": "node postinstall.js", - "prepare": "node prepare.js", - "serve": "vite preview" - }, - "version": "0.3.10" -} diff --git a/vue/postinstall.js b/vue/postinstall.js deleted file mode 100644 index 85edaa8c..00000000 --- a/vue/postinstall.js +++ /dev/null @@ -1,8 +0,0 @@ -const pkgjson=require('./package.json'); -var exec = require('child_process').exec; - -for (let pkg in pkgjson.dependencies) { - if (pkgjson.dependencies[pkg].startsWith('file:')) { - exec(`cd ./node_modules/${pkg} && npm install`); - } -} \ No newline at end of file diff --git a/vue/prepare.js b/vue/prepare.js deleted file mode 100644 index 56407aa3..00000000 --- a/vue/prepare.js +++ /dev/null @@ -1,7 +0,0 @@ -const pkgjson=require('./package.json'); - -for (let pkg in pkgjson.dependencies) { - if (pkgjson.dependencies[pkg].startsWith('file:')) { - console.error('\x1b[31m%s\x1b[0m', `Package '${pkg}' located at '${pkgjson.dependencies[pkg].replace('file:', '')}' needs to be published and your package.json file updated.`); - } -} \ No newline at end of file diff --git a/vue/public/favicon.ico b/vue/public/favicon.ico deleted file mode 100644 index df36fcfb..00000000 Binary files a/vue/public/favicon.ico and /dev/null differ diff --git a/vue/src/App.vue b/vue/src/App.vue deleted file mode 100644 index f4cd1666..00000000 --- a/vue/src/App.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - diff --git a/vue/src/main.js b/vue/src/main.js deleted file mode 100644 index fcdd833a..00000000 --- a/vue/src/main.js +++ /dev/null @@ -1,9 +0,0 @@ -import starportLibrary from '@starport/vue' -import { createApp } from 'vue' - -import App from './App.vue' -import router from './router' -import store from './store' - -const app = createApp(App) -app.use(store).use(router).use(starportLibrary).mount('#app') diff --git a/vue/src/router/index.js b/vue/src/router/index.js deleted file mode 100644 index a8bda572..00000000 --- a/vue/src/router/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import { createRouter, createWebHistory } from 'vue-router' - -import Data from '../views/Data.vue' -import Portfolio from '../views/Portfolio.vue' - -const routerHistory = createWebHistory() -const routes = [ - { path: '/', component: Portfolio }, - { path: '/portfolio', component: Portfolio }, - { path: '/data', component: Data } -] - -const router = createRouter({ - history: routerHistory, - routes -}) - -export default router diff --git a/vue/src/store/config.ts b/vue/src/store/config.ts deleted file mode 100644 index ec750832..00000000 --- a/vue/src/store/config.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { blocks, env, wallet } from '@starport/vuex' - -import generated from './generated' -export default function init(store) { - for (const moduleInit of Object.values(generated)) { - moduleInit(store) - } - blocks(store) - env(store) - wallet(store) -} diff --git a/vue/src/store/generated/cosmos.auth.v1beta1/index.ts b/vue/src/store/generated/cosmos.auth.v1beta1/index.ts deleted file mode 100755 index fcfde80e..00000000 --- a/vue/src/store/generated/cosmos.auth.v1beta1/index.ts +++ /dev/null @@ -1,409 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { BaseAccount } from "fairyring-client-ts/cosmos.auth.v1beta1/types" -import { ModuleAccount } from "fairyring-client-ts/cosmos.auth.v1beta1/types" -import { ModuleCredential } from "fairyring-client-ts/cosmos.auth.v1beta1/types" -import { Params } from "fairyring-client-ts/cosmos.auth.v1beta1/types" - - -export { BaseAccount, ModuleAccount, ModuleCredential, Params }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Accounts: {}, - Account: {}, - AccountAddressByID: {}, - Params: {}, - ModuleAccounts: {}, - ModuleAccountByName: {}, - Bech32Prefix: {}, - AddressBytesToString: {}, - AddressStringToBytes: {}, - AccountInfo: {}, - - _Structure: { - BaseAccount: getStructure(BaseAccount.fromPartial({})), - ModuleAccount: getStructure(ModuleAccount.fromPartial({})), - ModuleCredential: getStructure(ModuleCredential.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getAccounts: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Accounts[JSON.stringify(params)] ?? {} - }, - getAccount: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Account[JSON.stringify(params)] ?? {} - }, - getAccountAddressByID: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AccountAddressByID[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getModuleAccounts: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ModuleAccounts[JSON.stringify(params)] ?? {} - }, - getModuleAccountByName: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ModuleAccountByName[JSON.stringify(params)] ?? {} - }, - getBech32Prefix: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Bech32Prefix[JSON.stringify(params)] ?? {} - }, - getAddressBytesToString: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AddressBytesToString[JSON.stringify(params)] ?? {} - }, - getAddressStringToBytes: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AddressStringToBytes[JSON.stringify(params)] ?? {} - }, - getAccountInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AccountInfo[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.auth.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryAccounts({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryAccounts(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosAuthV1Beta1.query.queryAccounts({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Accounts', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAccounts', payload: { options: { all }, params: {...key},query }}) - return getters['getAccounts']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAccounts API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAccount({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryAccount( key.address)).data - - - commit('QUERY', { query: 'Account', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAccount', payload: { options: { all }, params: {...key},query }}) - return getters['getAccount']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAccount API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAccountAddressByID({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryAccountAddressByID( key.id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosAuthV1Beta1.query.queryAccountAddressByID( key.id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AccountAddressByID', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAccountAddressByID', payload: { options: { all }, params: {...key},query }}) - return getters['getAccountAddressByID']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAccountAddressByID API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryModuleAccounts({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryModuleAccounts()).data - - - commit('QUERY', { query: 'ModuleAccounts', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryModuleAccounts', payload: { options: { all }, params: {...key},query }}) - return getters['getModuleAccounts']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryModuleAccounts API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryModuleAccountByName({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryModuleAccountByName( key.name)).data - - - commit('QUERY', { query: 'ModuleAccountByName', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryModuleAccountByName', payload: { options: { all }, params: {...key},query }}) - return getters['getModuleAccountByName']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryModuleAccountByName API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryBech32Prefix({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryBech32Prefix()).data - - - commit('QUERY', { query: 'Bech32Prefix', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryBech32Prefix', payload: { options: { all }, params: {...key},query }}) - return getters['getBech32Prefix']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryBech32Prefix API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAddressBytesToString({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryAddressBytesToString( key.address_bytes)).data - - - commit('QUERY', { query: 'AddressBytesToString', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAddressBytesToString', payload: { options: { all }, params: {...key},query }}) - return getters['getAddressBytesToString']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAddressBytesToString API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAddressStringToBytes({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryAddressStringToBytes( key.address_string)).data - - - commit('QUERY', { query: 'AddressStringToBytes', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAddressStringToBytes', payload: { options: { all }, params: {...key},query }}) - return getters['getAddressStringToBytes']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAddressStringToBytes API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAccountInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthV1Beta1.query.queryAccountInfo( key.address)).data - - - commit('QUERY', { query: 'AccountInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAccountInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getAccountInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAccountInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.authz.v1beta1/index.ts b/vue/src/store/generated/cosmos.authz.v1beta1/index.ts deleted file mode 100755 index ea8689f1..00000000 --- a/vue/src/store/generated/cosmos.authz.v1beta1/index.ts +++ /dev/null @@ -1,295 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { GenericAuthorization } from "fairyring-client-ts/cosmos.authz.v1beta1/types" -import { Grant } from "fairyring-client-ts/cosmos.authz.v1beta1/types" -import { GrantAuthorization } from "fairyring-client-ts/cosmos.authz.v1beta1/types" -import { GrantQueueItem } from "fairyring-client-ts/cosmos.authz.v1beta1/types" -import { EventGrant } from "fairyring-client-ts/cosmos.authz.v1beta1/types" -import { EventRevoke } from "fairyring-client-ts/cosmos.authz.v1beta1/types" - - -export { GenericAuthorization, Grant, GrantAuthorization, GrantQueueItem, EventGrant, EventRevoke }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Grants: {}, - GranterGrants: {}, - GranteeGrants: {}, - - _Structure: { - GenericAuthorization: getStructure(GenericAuthorization.fromPartial({})), - Grant: getStructure(Grant.fromPartial({})), - GrantAuthorization: getStructure(GrantAuthorization.fromPartial({})), - GrantQueueItem: getStructure(GrantQueueItem.fromPartial({})), - EventGrant: getStructure(EventGrant.fromPartial({})), - EventRevoke: getStructure(EventRevoke.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getGrants: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Grants[JSON.stringify(params)] ?? {} - }, - getGranterGrants: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GranterGrants[JSON.stringify(params)] ?? {} - }, - getGranteeGrants: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GranteeGrants[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.authz.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryGrants({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthzV1Beta1.query.queryGrants(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosAuthzV1Beta1.query.queryGrants({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Grants', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGrants', payload: { options: { all }, params: {...key},query }}) - return getters['getGrants']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGrants API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryGranterGrants({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthzV1Beta1.query.queryGranterGrants( key.granter, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosAuthzV1Beta1.query.queryGranterGrants( key.granter, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GranterGrants', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGranterGrants', payload: { options: { all }, params: {...key},query }}) - return getters['getGranterGrants']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGranterGrants API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryGranteeGrants({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosAuthzV1Beta1.query.queryGranteeGrants( key.grantee, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosAuthzV1Beta1.query.queryGranteeGrants( key.grantee, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GranteeGrants', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGranteeGrants', payload: { options: { all }, params: {...key},query }}) - return getters['getGranteeGrants']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGranteeGrants API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgGrant({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosAuthzV1Beta1.tx.sendMsgGrant({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgGrant:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgGrant:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgRevoke({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosAuthzV1Beta1.tx.sendMsgRevoke({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevoke:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRevoke:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgExec({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosAuthzV1Beta1.tx.sendMsgExec({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgExec:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgExec:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgGrant({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosAuthzV1Beta1.tx.msgGrant({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgGrant:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgGrant:Create Could not create message: ' + e.message) - } - } - }, - async MsgRevoke({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosAuthzV1Beta1.tx.msgRevoke({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevoke:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgRevoke:Create Could not create message: ' + e.message) - } - } - }, - async MsgExec({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosAuthzV1Beta1.tx.msgExec({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgExec:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgExec:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.bank.v1beta1/index.ts b/vue/src/store/generated/cosmos.bank.v1beta1/index.ts deleted file mode 100755 index ca69dc22..00000000 --- a/vue/src/store/generated/cosmos.bank.v1beta1/index.ts +++ /dev/null @@ -1,532 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { SendAuthorization } from "fairyring-client-ts/cosmos.bank.v1beta1/types" -import { Params } from "fairyring-client-ts/cosmos.bank.v1beta1/types" -import { SendEnabled } from "fairyring-client-ts/cosmos.bank.v1beta1/types" -import { Input } from "fairyring-client-ts/cosmos.bank.v1beta1/types" -import { Output } from "fairyring-client-ts/cosmos.bank.v1beta1/types" -import { Supply } from "fairyring-client-ts/cosmos.bank.v1beta1/types" -import { DenomUnit } from "fairyring-client-ts/cosmos.bank.v1beta1/types" -import { Metadata } from "fairyring-client-ts/cosmos.bank.v1beta1/types" -import { Balance } from "fairyring-client-ts/cosmos.bank.v1beta1/types" -import { DenomOwner } from "fairyring-client-ts/cosmos.bank.v1beta1/types" - - -export { SendAuthorization, Params, SendEnabled, Input, Output, Supply, DenomUnit, Metadata, Balance, DenomOwner }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Balance: {}, - AllBalances: {}, - SpendableBalances: {}, - SpendableBalanceByDenom: {}, - TotalSupply: {}, - SupplyOf: {}, - Params: {}, - DenomMetadata: {}, - DenomsMetadata: {}, - DenomOwners: {}, - SendEnabled: {}, - - _Structure: { - SendAuthorization: getStructure(SendAuthorization.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - SendEnabled: getStructure(SendEnabled.fromPartial({})), - Input: getStructure(Input.fromPartial({})), - Output: getStructure(Output.fromPartial({})), - Supply: getStructure(Supply.fromPartial({})), - DenomUnit: getStructure(DenomUnit.fromPartial({})), - Metadata: getStructure(Metadata.fromPartial({})), - Balance: getStructure(Balance.fromPartial({})), - DenomOwner: getStructure(DenomOwner.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getBalance: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Balance[JSON.stringify(params)] ?? {} - }, - getAllBalances: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AllBalances[JSON.stringify(params)] ?? {} - }, - getSpendableBalances: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.SpendableBalances[JSON.stringify(params)] ?? {} - }, - getSpendableBalanceByDenom: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.SpendableBalanceByDenom[JSON.stringify(params)] ?? {} - }, - getTotalSupply: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TotalSupply[JSON.stringify(params)] ?? {} - }, - getSupplyOf: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.SupplyOf[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getDenomMetadata: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomMetadata[JSON.stringify(params)] ?? {} - }, - getDenomsMetadata: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomsMetadata[JSON.stringify(params)] ?? {} - }, - getDenomOwners: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomOwners[JSON.stringify(params)] ?? {} - }, - getSendEnabled: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.SendEnabled[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.bank.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryBalance({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.queryBalance( key.address, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBankV1Beta1.query.queryBalance( key.address, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Balance', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryBalance', payload: { options: { all }, params: {...key},query }}) - return getters['getBalance']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryBalance API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAllBalances({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.queryAllBalances( key.address, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBankV1Beta1.query.queryAllBalances( key.address, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AllBalances', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllBalances', payload: { options: { all }, params: {...key},query }}) - return getters['getAllBalances']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllBalances API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySpendableBalances({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.querySpendableBalances( key.address, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBankV1Beta1.query.querySpendableBalances( key.address, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'SpendableBalances', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySpendableBalances', payload: { options: { all }, params: {...key},query }}) - return getters['getSpendableBalances']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySpendableBalances API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySpendableBalanceByDenom({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.querySpendableBalanceByDenom( key.address, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBankV1Beta1.query.querySpendableBalanceByDenom( key.address, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'SpendableBalanceByDenom', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySpendableBalanceByDenom', payload: { options: { all }, params: {...key},query }}) - return getters['getSpendableBalanceByDenom']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySpendableBalanceByDenom API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryTotalSupply({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.queryTotalSupply(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBankV1Beta1.query.queryTotalSupply({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'TotalSupply', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryTotalSupply', payload: { options: { all }, params: {...key},query }}) - return getters['getTotalSupply']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryTotalSupply API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySupplyOf({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.querySupplyOf(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBankV1Beta1.query.querySupplyOf({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'SupplyOf', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySupplyOf', payload: { options: { all }, params: {...key},query }}) - return getters['getSupplyOf']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySupplyOf API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDenomMetadata({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.queryDenomMetadata( key.denom)).data - - - commit('QUERY', { query: 'DenomMetadata', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomMetadata', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomMetadata']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomMetadata API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDenomsMetadata({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.queryDenomsMetadata(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBankV1Beta1.query.queryDenomsMetadata({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DenomsMetadata', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomsMetadata', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomsMetadata']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomsMetadata API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDenomOwners({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.queryDenomOwners( key.denom, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBankV1Beta1.query.queryDenomOwners( key.denom, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DenomOwners', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomOwners', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomOwners']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomOwners API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySendEnabled({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBankV1Beta1.query.querySendEnabled(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBankV1Beta1.query.querySendEnabled({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'SendEnabled', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySendEnabled', payload: { options: { all }, params: {...key},query }}) - return getters['getSendEnabled']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySendEnabled API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgSend({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosBankV1Beta1.tx.sendMsgSend({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSend:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSend:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgMultiSend({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosBankV1Beta1.tx.sendMsgMultiSend({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgMultiSend:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgMultiSend:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgSend({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosBankV1Beta1.tx.msgSend({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSend:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSend:Create Could not create message: ' + e.message) - } - } - }, - async MsgMultiSend({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosBankV1Beta1.tx.msgMultiSend({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgMultiSend:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgMultiSend:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.base.node.v1beta1/index.ts b/vue/src/store/generated/cosmos.base.node.v1beta1/index.ts deleted file mode 100755 index 003a546f..00000000 --- a/vue/src/store/generated/cosmos.base.node.v1beta1/index.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - - - -export { }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Config: {}, - - _Structure: { - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getConfig: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Config[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.base.node.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async ServiceConfig({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBaseNodeV1Beta1.query.serviceConfig()).data - - - commit('QUERY', { query: 'Config', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceConfig', payload: { options: { all }, params: {...key},query }}) - return getters['getConfig']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceConfig API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.base.tendermint.v1beta1/index.ts b/vue/src/store/generated/cosmos.base.tendermint.v1beta1/index.ts deleted file mode 100755 index 1f8249c8..00000000 --- a/vue/src/store/generated/cosmos.base.tendermint.v1beta1/index.ts +++ /dev/null @@ -1,332 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Validator } from "fairyring-client-ts/cosmos.base.tendermint.v1beta1/types" -import { VersionInfo } from "fairyring-client-ts/cosmos.base.tendermint.v1beta1/types" -import { Module } from "fairyring-client-ts/cosmos.base.tendermint.v1beta1/types" -import { ProofOp } from "fairyring-client-ts/cosmos.base.tendermint.v1beta1/types" -import { ProofOps } from "fairyring-client-ts/cosmos.base.tendermint.v1beta1/types" -import { Block } from "fairyring-client-ts/cosmos.base.tendermint.v1beta1/types" -import { Header } from "fairyring-client-ts/cosmos.base.tendermint.v1beta1/types" - - -export { Validator, VersionInfo, Module, ProofOp, ProofOps, Block, Header }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - GetNodeInfo: {}, - GetSyncing: {}, - GetLatestBlock: {}, - GetBlockByHeight: {}, - GetLatestValidatorSet: {}, - GetValidatorSetByHeight: {}, - ABCIQuery: {}, - - _Structure: { - Validator: getStructure(Validator.fromPartial({})), - VersionInfo: getStructure(VersionInfo.fromPartial({})), - Module: getStructure(Module.fromPartial({})), - ProofOp: getStructure(ProofOp.fromPartial({})), - ProofOps: getStructure(ProofOps.fromPartial({})), - Block: getStructure(Block.fromPartial({})), - Header: getStructure(Header.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getGetNodeInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetNodeInfo[JSON.stringify(params)] ?? {} - }, - getGetSyncing: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetSyncing[JSON.stringify(params)] ?? {} - }, - getGetLatestBlock: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetLatestBlock[JSON.stringify(params)] ?? {} - }, - getGetBlockByHeight: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetBlockByHeight[JSON.stringify(params)] ?? {} - }, - getGetLatestValidatorSet: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetLatestValidatorSet[JSON.stringify(params)] ?? {} - }, - getGetValidatorSetByHeight: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetValidatorSetByHeight[JSON.stringify(params)] ?? {} - }, - getABCIQuery: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ABCIQuery[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.base.tendermint.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async ServiceGetNodeInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBaseTendermintV1Beta1.query.serviceGetNodeInfo()).data - - - commit('QUERY', { query: 'GetNodeInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetNodeInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getGetNodeInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetNodeInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetSyncing({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBaseTendermintV1Beta1.query.serviceGetSyncing()).data - - - commit('QUERY', { query: 'GetSyncing', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetSyncing', payload: { options: { all }, params: {...key},query }}) - return getters['getGetSyncing']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetSyncing API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetLatestBlock({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBaseTendermintV1Beta1.query.serviceGetLatestBlock()).data - - - commit('QUERY', { query: 'GetLatestBlock', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetLatestBlock', payload: { options: { all }, params: {...key},query }}) - return getters['getGetLatestBlock']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetLatestBlock API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetBlockByHeight({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBaseTendermintV1Beta1.query.serviceGetBlockByHeight( key.height)).data - - - commit('QUERY', { query: 'GetBlockByHeight', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetBlockByHeight', payload: { options: { all }, params: {...key},query }}) - return getters['getGetBlockByHeight']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetBlockByHeight API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetLatestValidatorSet({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBaseTendermintV1Beta1.query.serviceGetLatestValidatorSet(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBaseTendermintV1Beta1.query.serviceGetLatestValidatorSet({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GetLatestValidatorSet', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetLatestValidatorSet', payload: { options: { all }, params: {...key},query }}) - return getters['getGetLatestValidatorSet']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetLatestValidatorSet API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetValidatorSetByHeight({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBaseTendermintV1Beta1.query.serviceGetValidatorSetByHeight( key.height, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBaseTendermintV1Beta1.query.serviceGetValidatorSetByHeight( key.height, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GetValidatorSetByHeight', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetValidatorSetByHeight', payload: { options: { all }, params: {...key},query }}) - return getters['getGetValidatorSetByHeight']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetValidatorSetByHeight API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceABCIQuery({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosBaseTendermintV1Beta1.query.serviceABCIQuery(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosBaseTendermintV1Beta1.query.serviceABCIQuery({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ABCIQuery', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceABCIQuery', payload: { options: { all }, params: {...key},query }}) - return getters['getABCIQuery']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceABCIQuery API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.consensus.v1/index.ts b/vue/src/store/generated/cosmos.consensus.v1/index.ts deleted file mode 100755 index 63e3631e..00000000 --- a/vue/src/store/generated/cosmos.consensus.v1/index.ts +++ /dev/null @@ -1,159 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - - - -export { }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - - _Structure: { - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.consensus.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosConsensusV1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgUpdateParams({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosConsensusV1.tx.sendMsgUpdateParams({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateParams:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateParams:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgUpdateParams({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosConsensusV1.tx.msgUpdateParams({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateParams:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateParams:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.crisis.v1beta1/index.ts b/vue/src/store/generated/cosmos.crisis.v1beta1/index.ts deleted file mode 100755 index 44ee3de7..00000000 --- a/vue/src/store/generated/cosmos.crisis.v1beta1/index.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - - - -export { }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - - _Structure: { - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.crisis.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - async sendMsgVerifyInvariant({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosCrisisV1Beta1.tx.sendMsgVerifyInvariant({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVerifyInvariant:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVerifyInvariant:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdateParams({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosCrisisV1Beta1.tx.sendMsgUpdateParams({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateParams:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateParams:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgVerifyInvariant({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosCrisisV1Beta1.tx.msgVerifyInvariant({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVerifyInvariant:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgVerifyInvariant:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdateParams({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosCrisisV1Beta1.tx.msgUpdateParams({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateParams:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateParams:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.distribution.v1beta1/index.ts b/vue/src/store/generated/cosmos.distribution.v1beta1/index.ts deleted file mode 100755 index 3a315628..00000000 --- a/vue/src/store/generated/cosmos.distribution.v1beta1/index.ts +++ /dev/null @@ -1,597 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Params } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorHistoricalRewards } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorCurrentRewards } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorAccumulatedCommission } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorOutstandingRewards } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorSlashEvent } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorSlashEvents } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { FeePool } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { CommunityPoolSpendProposal } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { DelegatorStartingInfo } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { DelegationDelegatorReward } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { CommunityPoolSpendProposalWithDeposit } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { DelegatorWithdrawInfo } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorOutstandingRewardsRecord } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorAccumulatedCommissionRecord } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorHistoricalRewardsRecord } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorCurrentRewardsRecord } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { DelegatorStartingInfoRecord } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" -import { ValidatorSlashEventRecord } from "fairyring-client-ts/cosmos.distribution.v1beta1/types" - - -export { Params, ValidatorHistoricalRewards, ValidatorCurrentRewards, ValidatorAccumulatedCommission, ValidatorOutstandingRewards, ValidatorSlashEvent, ValidatorSlashEvents, FeePool, CommunityPoolSpendProposal, DelegatorStartingInfo, DelegationDelegatorReward, CommunityPoolSpendProposalWithDeposit, DelegatorWithdrawInfo, ValidatorOutstandingRewardsRecord, ValidatorAccumulatedCommissionRecord, ValidatorHistoricalRewardsRecord, ValidatorCurrentRewardsRecord, DelegatorStartingInfoRecord, ValidatorSlashEventRecord }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - ValidatorDistributionInfo: {}, - ValidatorOutstandingRewards: {}, - ValidatorCommission: {}, - ValidatorSlashes: {}, - DelegationRewards: {}, - DelegationTotalRewards: {}, - DelegatorValidators: {}, - DelegatorWithdrawAddress: {}, - CommunityPool: {}, - - _Structure: { - Params: getStructure(Params.fromPartial({})), - ValidatorHistoricalRewards: getStructure(ValidatorHistoricalRewards.fromPartial({})), - ValidatorCurrentRewards: getStructure(ValidatorCurrentRewards.fromPartial({})), - ValidatorAccumulatedCommission: getStructure(ValidatorAccumulatedCommission.fromPartial({})), - ValidatorOutstandingRewards: getStructure(ValidatorOutstandingRewards.fromPartial({})), - ValidatorSlashEvent: getStructure(ValidatorSlashEvent.fromPartial({})), - ValidatorSlashEvents: getStructure(ValidatorSlashEvents.fromPartial({})), - FeePool: getStructure(FeePool.fromPartial({})), - CommunityPoolSpendProposal: getStructure(CommunityPoolSpendProposal.fromPartial({})), - DelegatorStartingInfo: getStructure(DelegatorStartingInfo.fromPartial({})), - DelegationDelegatorReward: getStructure(DelegationDelegatorReward.fromPartial({})), - CommunityPoolSpendProposalWithDeposit: getStructure(CommunityPoolSpendProposalWithDeposit.fromPartial({})), - DelegatorWithdrawInfo: getStructure(DelegatorWithdrawInfo.fromPartial({})), - ValidatorOutstandingRewardsRecord: getStructure(ValidatorOutstandingRewardsRecord.fromPartial({})), - ValidatorAccumulatedCommissionRecord: getStructure(ValidatorAccumulatedCommissionRecord.fromPartial({})), - ValidatorHistoricalRewardsRecord: getStructure(ValidatorHistoricalRewardsRecord.fromPartial({})), - ValidatorCurrentRewardsRecord: getStructure(ValidatorCurrentRewardsRecord.fromPartial({})), - DelegatorStartingInfoRecord: getStructure(DelegatorStartingInfoRecord.fromPartial({})), - ValidatorSlashEventRecord: getStructure(ValidatorSlashEventRecord.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getValidatorDistributionInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorDistributionInfo[JSON.stringify(params)] ?? {} - }, - getValidatorOutstandingRewards: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorOutstandingRewards[JSON.stringify(params)] ?? {} - }, - getValidatorCommission: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorCommission[JSON.stringify(params)] ?? {} - }, - getValidatorSlashes: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorSlashes[JSON.stringify(params)] ?? {} - }, - getDelegationRewards: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegationRewards[JSON.stringify(params)] ?? {} - }, - getDelegationTotalRewards: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegationTotalRewards[JSON.stringify(params)] ?? {} - }, - getDelegatorValidators: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorValidators[JSON.stringify(params)] ?? {} - }, - getDelegatorWithdrawAddress: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorWithdrawAddress[JSON.stringify(params)] ?? {} - }, - getCommunityPool: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.CommunityPool[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.distribution.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorDistributionInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryValidatorDistributionInfo( key.validator_address)).data - - - commit('QUERY', { query: 'ValidatorDistributionInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorDistributionInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorDistributionInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorDistributionInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorOutstandingRewards({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryValidatorOutstandingRewards( key.validator_address)).data - - - commit('QUERY', { query: 'ValidatorOutstandingRewards', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorOutstandingRewards', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorOutstandingRewards']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorOutstandingRewards API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorCommission({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryValidatorCommission( key.validator_address)).data - - - commit('QUERY', { query: 'ValidatorCommission', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorCommission', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorCommission']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorCommission API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorSlashes({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryValidatorSlashes( key.validator_address, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosDistributionV1Beta1.query.queryValidatorSlashes( key.validator_address, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ValidatorSlashes', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorSlashes', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorSlashes']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorSlashes API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegationRewards({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryDelegationRewards( key.delegator_address, key.validator_address)).data - - - commit('QUERY', { query: 'DelegationRewards', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegationRewards', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegationRewards']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegationRewards API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegationTotalRewards({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryDelegationTotalRewards( key.delegator_address)).data - - - commit('QUERY', { query: 'DelegationTotalRewards', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegationTotalRewards', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegationTotalRewards']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegationTotalRewards API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorValidators({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryDelegatorValidators( key.delegator_address)).data - - - commit('QUERY', { query: 'DelegatorValidators', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorValidators', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorValidators']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorValidators API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorWithdrawAddress({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryDelegatorWithdrawAddress( key.delegator_address)).data - - - commit('QUERY', { query: 'DelegatorWithdrawAddress', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorWithdrawAddress', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorWithdrawAddress']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorWithdrawAddress API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryCommunityPool({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosDistributionV1Beta1.query.queryCommunityPool()).data - - - commit('QUERY', { query: 'CommunityPool', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryCommunityPool', payload: { options: { all }, params: {...key},query }}) - return getters['getCommunityPool']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryCommunityPool API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgUpdateParams({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosDistributionV1Beta1.tx.sendMsgUpdateParams({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateParams:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateParams:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCommunityPoolSpend({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosDistributionV1Beta1.tx.sendMsgCommunityPoolSpend({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommunityPoolSpend:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCommunityPoolSpend:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgFundCommunityPool({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosDistributionV1Beta1.tx.sendMsgFundCommunityPool({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgFundCommunityPool:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgFundCommunityPool:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgSetWithdrawAddress({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosDistributionV1Beta1.tx.sendMsgSetWithdrawAddress({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSetWithdrawAddress:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSetWithdrawAddress:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgWithdrawDelegatorReward({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosDistributionV1Beta1.tx.sendMsgWithdrawDelegatorReward({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawDelegatorReward:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgWithdrawDelegatorReward:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgWithdrawValidatorCommission({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosDistributionV1Beta1.tx.sendMsgWithdrawValidatorCommission({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawValidatorCommission:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgWithdrawValidatorCommission:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgUpdateParams({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosDistributionV1Beta1.tx.msgUpdateParams({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateParams:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateParams:Create Could not create message: ' + e.message) - } - } - }, - async MsgCommunityPoolSpend({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosDistributionV1Beta1.tx.msgCommunityPoolSpend({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommunityPoolSpend:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCommunityPoolSpend:Create Could not create message: ' + e.message) - } - } - }, - async MsgFundCommunityPool({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosDistributionV1Beta1.tx.msgFundCommunityPool({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgFundCommunityPool:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgFundCommunityPool:Create Could not create message: ' + e.message) - } - } - }, - async MsgSetWithdrawAddress({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosDistributionV1Beta1.tx.msgSetWithdrawAddress({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSetWithdrawAddress:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSetWithdrawAddress:Create Could not create message: ' + e.message) - } - } - }, - async MsgWithdrawDelegatorReward({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosDistributionV1Beta1.tx.msgWithdrawDelegatorReward({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawDelegatorReward:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgWithdrawDelegatorReward:Create Could not create message: ' + e.message) - } - } - }, - async MsgWithdrawValidatorCommission({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosDistributionV1Beta1.tx.msgWithdrawValidatorCommission({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawValidatorCommission:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgWithdrawValidatorCommission:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.evidence.v1beta1/index.ts b/vue/src/store/generated/cosmos.evidence.v1beta1/index.ts deleted file mode 100755 index 879d1c9a..00000000 --- a/vue/src/store/generated/cosmos.evidence.v1beta1/index.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Equivocation } from "fairyring-client-ts/cosmos.evidence.v1beta1/types" - - -export { Equivocation }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Evidence: {}, - AllEvidence: {}, - - _Structure: { - Equivocation: getStructure(Equivocation.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getEvidence: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Evidence[JSON.stringify(params)] ?? {} - }, - getAllEvidence: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AllEvidence[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.evidence.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryEvidence({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosEvidenceV1Beta1.query.queryEvidence( key.hash, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosEvidenceV1Beta1.query.queryEvidence( key.hash, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Evidence', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryEvidence', payload: { options: { all }, params: {...key},query }}) - return getters['getEvidence']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryEvidence API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAllEvidence({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosEvidenceV1Beta1.query.queryAllEvidence(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosEvidenceV1Beta1.query.queryAllEvidence({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AllEvidence', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllEvidence', payload: { options: { all }, params: {...key},query }}) - return getters['getAllEvidence']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllEvidence API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgSubmitEvidence({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosEvidenceV1Beta1.tx.sendMsgSubmitEvidence({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitEvidence:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitEvidence:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgSubmitEvidence({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosEvidenceV1Beta1.tx.msgSubmitEvidence({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitEvidence:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitEvidence:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.feegrant.v1beta1/index.ts b/vue/src/store/generated/cosmos.feegrant.v1beta1/index.ts deleted file mode 100755 index 2c741d61..00000000 --- a/vue/src/store/generated/cosmos.feegrant.v1beta1/index.ts +++ /dev/null @@ -1,260 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { BasicAllowance } from "fairyring-client-ts/cosmos.feegrant.v1beta1/types" -import { PeriodicAllowance } from "fairyring-client-ts/cosmos.feegrant.v1beta1/types" -import { AllowedMsgAllowance } from "fairyring-client-ts/cosmos.feegrant.v1beta1/types" -import { Grant } from "fairyring-client-ts/cosmos.feegrant.v1beta1/types" - - -export { BasicAllowance, PeriodicAllowance, AllowedMsgAllowance, Grant }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Allowance: {}, - Allowances: {}, - AllowancesByGranter: {}, - - _Structure: { - BasicAllowance: getStructure(BasicAllowance.fromPartial({})), - PeriodicAllowance: getStructure(PeriodicAllowance.fromPartial({})), - AllowedMsgAllowance: getStructure(AllowedMsgAllowance.fromPartial({})), - Grant: getStructure(Grant.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getAllowance: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Allowance[JSON.stringify(params)] ?? {} - }, - getAllowances: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Allowances[JSON.stringify(params)] ?? {} - }, - getAllowancesByGranter: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AllowancesByGranter[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.feegrant.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryAllowance({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosFeegrantV1Beta1.query.queryAllowance( key.granter, key.grantee)).data - - - commit('QUERY', { query: 'Allowance', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllowance', payload: { options: { all }, params: {...key},query }}) - return getters['getAllowance']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllowance API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAllowances({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosFeegrantV1Beta1.query.queryAllowances( key.grantee, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosFeegrantV1Beta1.query.queryAllowances( key.grantee, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Allowances', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllowances', payload: { options: { all }, params: {...key},query }}) - return getters['getAllowances']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllowances API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAllowancesByGranter({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosFeegrantV1Beta1.query.queryAllowancesByGranter( key.granter, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosFeegrantV1Beta1.query.queryAllowancesByGranter( key.granter, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AllowancesByGranter', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllowancesByGranter', payload: { options: { all }, params: {...key},query }}) - return getters['getAllowancesByGranter']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllowancesByGranter API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgRevokeAllowance({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosFeegrantV1Beta1.tx.sendMsgRevokeAllowance({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevokeAllowance:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRevokeAllowance:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgGrantAllowance({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosFeegrantV1Beta1.tx.sendMsgGrantAllowance({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgGrantAllowance:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgGrantAllowance:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgRevokeAllowance({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosFeegrantV1Beta1.tx.msgRevokeAllowance({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevokeAllowance:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgRevokeAllowance:Create Could not create message: ' + e.message) - } - } - }, - async MsgGrantAllowance({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosFeegrantV1Beta1.tx.msgGrantAllowance({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgGrantAllowance:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgGrantAllowance:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.gov.v1/index.ts b/vue/src/store/generated/cosmos.gov.v1/index.ts deleted file mode 100755 index 83472198..00000000 --- a/vue/src/store/generated/cosmos.gov.v1/index.ts +++ /dev/null @@ -1,500 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { WeightedVoteOption } from "fairyring-client-ts/cosmos.gov.v1/types" -import { Deposit } from "fairyring-client-ts/cosmos.gov.v1/types" -import { Proposal } from "fairyring-client-ts/cosmos.gov.v1/types" -import { TallyResult } from "fairyring-client-ts/cosmos.gov.v1/types" -import { Vote } from "fairyring-client-ts/cosmos.gov.v1/types" -import { DepositParams } from "fairyring-client-ts/cosmos.gov.v1/types" -import { VotingParams } from "fairyring-client-ts/cosmos.gov.v1/types" -import { TallyParams } from "fairyring-client-ts/cosmos.gov.v1/types" -import { Params } from "fairyring-client-ts/cosmos.gov.v1/types" - - -export { WeightedVoteOption, Deposit, Proposal, TallyResult, Vote, DepositParams, VotingParams, TallyParams, Params }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Proposal: {}, - Proposals: {}, - Vote: {}, - Votes: {}, - Params: {}, - Deposit: {}, - Deposits: {}, - TallyResult: {}, - - _Structure: { - WeightedVoteOption: getStructure(WeightedVoteOption.fromPartial({})), - Deposit: getStructure(Deposit.fromPartial({})), - Proposal: getStructure(Proposal.fromPartial({})), - TallyResult: getStructure(TallyResult.fromPartial({})), - Vote: getStructure(Vote.fromPartial({})), - DepositParams: getStructure(DepositParams.fromPartial({})), - VotingParams: getStructure(VotingParams.fromPartial({})), - TallyParams: getStructure(TallyParams.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getProposal: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Proposal[JSON.stringify(params)] ?? {} - }, - getProposals: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Proposals[JSON.stringify(params)] ?? {} - }, - getVote: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Vote[JSON.stringify(params)] ?? {} - }, - getVotes: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Votes[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getDeposit: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Deposit[JSON.stringify(params)] ?? {} - }, - getDeposits: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Deposits[JSON.stringify(params)] ?? {} - }, - getTallyResult: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TallyResult[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.gov.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryProposal({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1.query.queryProposal( key.proposal_id)).data - - - commit('QUERY', { query: 'Proposal', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryProposal', payload: { options: { all }, params: {...key},query }}) - return getters['getProposal']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryProposal API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryProposals({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1.query.queryProposals(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGovV1.query.queryProposals({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Proposals', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryProposals', payload: { options: { all }, params: {...key},query }}) - return getters['getProposals']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryProposals API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryVote({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1.query.queryVote( key.proposal_id, key.voter)).data - - - commit('QUERY', { query: 'Vote', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryVote', payload: { options: { all }, params: {...key},query }}) - return getters['getVote']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryVote API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryVotes({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1.query.queryVotes( key.proposal_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGovV1.query.queryVotes( key.proposal_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Votes', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryVotes', payload: { options: { all }, params: {...key},query }}) - return getters['getVotes']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryVotes API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1.query.queryParams( key.params_type)).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDeposit({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1.query.queryDeposit( key.proposal_id, key.depositor)).data - - - commit('QUERY', { query: 'Deposit', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDeposit', payload: { options: { all }, params: {...key},query }}) - return getters['getDeposit']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDeposit API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDeposits({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1.query.queryDeposits( key.proposal_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGovV1.query.queryDeposits( key.proposal_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Deposits', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDeposits', payload: { options: { all }, params: {...key},query }}) - return getters['getDeposits']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDeposits API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryTallyResult({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1.query.queryTallyResult( key.proposal_id)).data - - - commit('QUERY', { query: 'TallyResult', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryTallyResult', payload: { options: { all }, params: {...key},query }}) - return getters['getTallyResult']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryTallyResult API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgSubmitProposal({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGovV1.tx.sendMsgSubmitProposal({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitProposal:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitProposal:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgVote({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGovV1.tx.sendMsgVote({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVote:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVote:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgVoteWeighted({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGovV1.tx.sendMsgVoteWeighted({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVoteWeighted:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVoteWeighted:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdateParams({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGovV1.tx.sendMsgUpdateParams({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateParams:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateParams:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgDeposit({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGovV1.tx.sendMsgDeposit({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeposit:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgDeposit:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgSubmitProposal({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGovV1.tx.msgSubmitProposal({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitProposal:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitProposal:Create Could not create message: ' + e.message) - } - } - }, - async MsgVote({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGovV1.tx.msgVote({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVote:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgVote:Create Could not create message: ' + e.message) - } - } - }, - async MsgVoteWeighted({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGovV1.tx.msgVoteWeighted({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVoteWeighted:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgVoteWeighted:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdateParams({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGovV1.tx.msgUpdateParams({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateParams:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateParams:Create Could not create message: ' + e.message) - } - } - }, - async MsgDeposit({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGovV1.tx.msgDeposit({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeposit:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgDeposit:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.gov.v1beta1/index.ts b/vue/src/store/generated/cosmos.gov.v1beta1/index.ts deleted file mode 100755 index b3fed67e..00000000 --- a/vue/src/store/generated/cosmos.gov.v1beta1/index.ts +++ /dev/null @@ -1,473 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { WeightedVoteOption } from "fairyring-client-ts/cosmos.gov.v1beta1/types" -import { TextProposal } from "fairyring-client-ts/cosmos.gov.v1beta1/types" -import { Deposit } from "fairyring-client-ts/cosmos.gov.v1beta1/types" -import { Proposal } from "fairyring-client-ts/cosmos.gov.v1beta1/types" -import { TallyResult } from "fairyring-client-ts/cosmos.gov.v1beta1/types" -import { Vote } from "fairyring-client-ts/cosmos.gov.v1beta1/types" -import { DepositParams } from "fairyring-client-ts/cosmos.gov.v1beta1/types" -import { VotingParams } from "fairyring-client-ts/cosmos.gov.v1beta1/types" -import { TallyParams } from "fairyring-client-ts/cosmos.gov.v1beta1/types" - - -export { WeightedVoteOption, TextProposal, Deposit, Proposal, TallyResult, Vote, DepositParams, VotingParams, TallyParams }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Proposal: {}, - Proposals: {}, - Vote: {}, - Votes: {}, - Params: {}, - Deposit: {}, - Deposits: {}, - TallyResult: {}, - - _Structure: { - WeightedVoteOption: getStructure(WeightedVoteOption.fromPartial({})), - TextProposal: getStructure(TextProposal.fromPartial({})), - Deposit: getStructure(Deposit.fromPartial({})), - Proposal: getStructure(Proposal.fromPartial({})), - TallyResult: getStructure(TallyResult.fromPartial({})), - Vote: getStructure(Vote.fromPartial({})), - DepositParams: getStructure(DepositParams.fromPartial({})), - VotingParams: getStructure(VotingParams.fromPartial({})), - TallyParams: getStructure(TallyParams.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getProposal: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Proposal[JSON.stringify(params)] ?? {} - }, - getProposals: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Proposals[JSON.stringify(params)] ?? {} - }, - getVote: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Vote[JSON.stringify(params)] ?? {} - }, - getVotes: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Votes[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getDeposit: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Deposit[JSON.stringify(params)] ?? {} - }, - getDeposits: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Deposits[JSON.stringify(params)] ?? {} - }, - getTallyResult: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TallyResult[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.gov.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryProposal({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1Beta1.query.queryProposal( key.proposal_id)).data - - - commit('QUERY', { query: 'Proposal', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryProposal', payload: { options: { all }, params: {...key},query }}) - return getters['getProposal']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryProposal API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryProposals({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1Beta1.query.queryProposals(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGovV1Beta1.query.queryProposals({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Proposals', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryProposals', payload: { options: { all }, params: {...key},query }}) - return getters['getProposals']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryProposals API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryVote({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1Beta1.query.queryVote( key.proposal_id, key.voter)).data - - - commit('QUERY', { query: 'Vote', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryVote', payload: { options: { all }, params: {...key},query }}) - return getters['getVote']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryVote API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryVotes({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1Beta1.query.queryVotes( key.proposal_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGovV1Beta1.query.queryVotes( key.proposal_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Votes', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryVotes', payload: { options: { all }, params: {...key},query }}) - return getters['getVotes']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryVotes API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1Beta1.query.queryParams( key.params_type)).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDeposit({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1Beta1.query.queryDeposit( key.proposal_id, key.depositor)).data - - - commit('QUERY', { query: 'Deposit', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDeposit', payload: { options: { all }, params: {...key},query }}) - return getters['getDeposit']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDeposit API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDeposits({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1Beta1.query.queryDeposits( key.proposal_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGovV1Beta1.query.queryDeposits( key.proposal_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Deposits', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDeposits', payload: { options: { all }, params: {...key},query }}) - return getters['getDeposits']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDeposits API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryTallyResult({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGovV1Beta1.query.queryTallyResult( key.proposal_id)).data - - - commit('QUERY', { query: 'TallyResult', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryTallyResult', payload: { options: { all }, params: {...key},query }}) - return getters['getTallyResult']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryTallyResult API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgDeposit({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGovV1Beta1.tx.sendMsgDeposit({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeposit:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgDeposit:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgVoteWeighted({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGovV1Beta1.tx.sendMsgVoteWeighted({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVoteWeighted:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVoteWeighted:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgSubmitProposal({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGovV1Beta1.tx.sendMsgSubmitProposal({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitProposal:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitProposal:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgVote({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGovV1Beta1.tx.sendMsgVote({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVote:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVote:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgDeposit({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGovV1Beta1.tx.msgDeposit({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeposit:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgDeposit:Create Could not create message: ' + e.message) - } - } - }, - async MsgVoteWeighted({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGovV1Beta1.tx.msgVoteWeighted({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVoteWeighted:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgVoteWeighted:Create Could not create message: ' + e.message) - } - } - }, - async MsgSubmitProposal({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGovV1Beta1.tx.msgSubmitProposal({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitProposal:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitProposal:Create Could not create message: ' + e.message) - } - } - }, - async MsgVote({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGovV1Beta1.tx.msgVote({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVote:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgVote:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.group.v1/index.ts b/vue/src/store/generated/cosmos.group.v1/index.ts deleted file mode 100755 index c867bc84..00000000 --- a/vue/src/store/generated/cosmos.group.v1/index.ts +++ /dev/null @@ -1,965 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { EventCreateGroup } from "fairyring-client-ts/cosmos.group.v1/types" -import { EventUpdateGroup } from "fairyring-client-ts/cosmos.group.v1/types" -import { EventCreateGroupPolicy } from "fairyring-client-ts/cosmos.group.v1/types" -import { EventUpdateGroupPolicy } from "fairyring-client-ts/cosmos.group.v1/types" -import { EventSubmitProposal } from "fairyring-client-ts/cosmos.group.v1/types" -import { EventWithdrawProposal } from "fairyring-client-ts/cosmos.group.v1/types" -import { EventVote } from "fairyring-client-ts/cosmos.group.v1/types" -import { EventExec } from "fairyring-client-ts/cosmos.group.v1/types" -import { EventLeaveGroup } from "fairyring-client-ts/cosmos.group.v1/types" -import { EventProposalPruned } from "fairyring-client-ts/cosmos.group.v1/types" -import { Member } from "fairyring-client-ts/cosmos.group.v1/types" -import { MemberRequest } from "fairyring-client-ts/cosmos.group.v1/types" -import { ThresholdDecisionPolicy } from "fairyring-client-ts/cosmos.group.v1/types" -import { PercentageDecisionPolicy } from "fairyring-client-ts/cosmos.group.v1/types" -import { DecisionPolicyWindows } from "fairyring-client-ts/cosmos.group.v1/types" -import { GroupInfo } from "fairyring-client-ts/cosmos.group.v1/types" -import { GroupMember } from "fairyring-client-ts/cosmos.group.v1/types" -import { GroupPolicyInfo } from "fairyring-client-ts/cosmos.group.v1/types" -import { Proposal } from "fairyring-client-ts/cosmos.group.v1/types" -import { TallyResult } from "fairyring-client-ts/cosmos.group.v1/types" -import { Vote } from "fairyring-client-ts/cosmos.group.v1/types" - - -export { EventCreateGroup, EventUpdateGroup, EventCreateGroupPolicy, EventUpdateGroupPolicy, EventSubmitProposal, EventWithdrawProposal, EventVote, EventExec, EventLeaveGroup, EventProposalPruned, Member, MemberRequest, ThresholdDecisionPolicy, PercentageDecisionPolicy, DecisionPolicyWindows, GroupInfo, GroupMember, GroupPolicyInfo, Proposal, TallyResult, Vote }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - GroupInfo: {}, - GroupPolicyInfo: {}, - GroupMembers: {}, - GroupsByAdmin: {}, - GroupPoliciesByGroup: {}, - GroupPoliciesByAdmin: {}, - Proposal: {}, - ProposalsByGroupPolicy: {}, - VoteByProposalVoter: {}, - VotesByProposal: {}, - VotesByVoter: {}, - GroupsByMember: {}, - TallyResult: {}, - Groups: {}, - - _Structure: { - EventCreateGroup: getStructure(EventCreateGroup.fromPartial({})), - EventUpdateGroup: getStructure(EventUpdateGroup.fromPartial({})), - EventCreateGroupPolicy: getStructure(EventCreateGroupPolicy.fromPartial({})), - EventUpdateGroupPolicy: getStructure(EventUpdateGroupPolicy.fromPartial({})), - EventSubmitProposal: getStructure(EventSubmitProposal.fromPartial({})), - EventWithdrawProposal: getStructure(EventWithdrawProposal.fromPartial({})), - EventVote: getStructure(EventVote.fromPartial({})), - EventExec: getStructure(EventExec.fromPartial({})), - EventLeaveGroup: getStructure(EventLeaveGroup.fromPartial({})), - EventProposalPruned: getStructure(EventProposalPruned.fromPartial({})), - Member: getStructure(Member.fromPartial({})), - MemberRequest: getStructure(MemberRequest.fromPartial({})), - ThresholdDecisionPolicy: getStructure(ThresholdDecisionPolicy.fromPartial({})), - PercentageDecisionPolicy: getStructure(PercentageDecisionPolicy.fromPartial({})), - DecisionPolicyWindows: getStructure(DecisionPolicyWindows.fromPartial({})), - GroupInfo: getStructure(GroupInfo.fromPartial({})), - GroupMember: getStructure(GroupMember.fromPartial({})), - GroupPolicyInfo: getStructure(GroupPolicyInfo.fromPartial({})), - Proposal: getStructure(Proposal.fromPartial({})), - TallyResult: getStructure(TallyResult.fromPartial({})), - Vote: getStructure(Vote.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getGroupInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GroupInfo[JSON.stringify(params)] ?? {} - }, - getGroupPolicyInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GroupPolicyInfo[JSON.stringify(params)] ?? {} - }, - getGroupMembers: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GroupMembers[JSON.stringify(params)] ?? {} - }, - getGroupsByAdmin: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GroupsByAdmin[JSON.stringify(params)] ?? {} - }, - getGroupPoliciesByGroup: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GroupPoliciesByGroup[JSON.stringify(params)] ?? {} - }, - getGroupPoliciesByAdmin: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GroupPoliciesByAdmin[JSON.stringify(params)] ?? {} - }, - getProposal: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Proposal[JSON.stringify(params)] ?? {} - }, - getProposalsByGroupPolicy: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ProposalsByGroupPolicy[JSON.stringify(params)] ?? {} - }, - getVoteByProposalVoter: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.VoteByProposalVoter[JSON.stringify(params)] ?? {} - }, - getVotesByProposal: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.VotesByProposal[JSON.stringify(params)] ?? {} - }, - getVotesByVoter: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.VotesByVoter[JSON.stringify(params)] ?? {} - }, - getGroupsByMember: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GroupsByMember[JSON.stringify(params)] ?? {} - }, - getTallyResult: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TallyResult[JSON.stringify(params)] ?? {} - }, - getGroups: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Groups[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.group.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryGroupInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryGroupInfo( key.group_id)).data - - - commit('QUERY', { query: 'GroupInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGroupInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getGroupInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGroupInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryGroupPolicyInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryGroupPolicyInfo( key.address)).data - - - commit('QUERY', { query: 'GroupPolicyInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGroupPolicyInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getGroupPolicyInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGroupPolicyInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryGroupMembers({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryGroupMembers( key.group_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGroupV1.query.queryGroupMembers( key.group_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GroupMembers', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGroupMembers', payload: { options: { all }, params: {...key},query }}) - return getters['getGroupMembers']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGroupMembers API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryGroupsByAdmin({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryGroupsByAdmin( key.admin, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGroupV1.query.queryGroupsByAdmin( key.admin, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GroupsByAdmin', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGroupsByAdmin', payload: { options: { all }, params: {...key},query }}) - return getters['getGroupsByAdmin']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGroupsByAdmin API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryGroupPoliciesByGroup({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryGroupPoliciesByGroup( key.group_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGroupV1.query.queryGroupPoliciesByGroup( key.group_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GroupPoliciesByGroup', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGroupPoliciesByGroup', payload: { options: { all }, params: {...key},query }}) - return getters['getGroupPoliciesByGroup']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGroupPoliciesByGroup API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryGroupPoliciesByAdmin({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryGroupPoliciesByAdmin( key.admin, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGroupV1.query.queryGroupPoliciesByAdmin( key.admin, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GroupPoliciesByAdmin', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGroupPoliciesByAdmin', payload: { options: { all }, params: {...key},query }}) - return getters['getGroupPoliciesByAdmin']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGroupPoliciesByAdmin API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryProposal({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryProposal( key.proposal_id)).data - - - commit('QUERY', { query: 'Proposal', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryProposal', payload: { options: { all }, params: {...key},query }}) - return getters['getProposal']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryProposal API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryProposalsByGroupPolicy({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryProposalsByGroupPolicy( key.address, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGroupV1.query.queryProposalsByGroupPolicy( key.address, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ProposalsByGroupPolicy', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryProposalsByGroupPolicy', payload: { options: { all }, params: {...key},query }}) - return getters['getProposalsByGroupPolicy']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryProposalsByGroupPolicy API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryVoteByProposalVoter({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryVoteByProposalVoter( key.proposal_id, key.voter)).data - - - commit('QUERY', { query: 'VoteByProposalVoter', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryVoteByProposalVoter', payload: { options: { all }, params: {...key},query }}) - return getters['getVoteByProposalVoter']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryVoteByProposalVoter API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryVotesByProposal({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryVotesByProposal( key.proposal_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGroupV1.query.queryVotesByProposal( key.proposal_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'VotesByProposal', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryVotesByProposal', payload: { options: { all }, params: {...key},query }}) - return getters['getVotesByProposal']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryVotesByProposal API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryVotesByVoter({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryVotesByVoter( key.voter, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGroupV1.query.queryVotesByVoter( key.voter, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'VotesByVoter', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryVotesByVoter', payload: { options: { all }, params: {...key},query }}) - return getters['getVotesByVoter']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryVotesByVoter API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryGroupsByMember({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryGroupsByMember( key.address, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGroupV1.query.queryGroupsByMember( key.address, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GroupsByMember', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGroupsByMember', payload: { options: { all }, params: {...key},query }}) - return getters['getGroupsByMember']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGroupsByMember API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryTallyResult({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryTallyResult( key.proposal_id)).data - - - commit('QUERY', { query: 'TallyResult', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryTallyResult', payload: { options: { all }, params: {...key},query }}) - return getters['getTallyResult']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryTallyResult API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryGroups({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosGroupV1.query.queryGroups(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosGroupV1.query.queryGroups({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Groups', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryGroups', payload: { options: { all }, params: {...key},query }}) - return getters['getGroups']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryGroups API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgCreateGroup({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgCreateGroup({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateGroup:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateGroup:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgLeaveGroup({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgLeaveGroup({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgLeaveGroup:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgLeaveGroup:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdateGroupMetadata({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgUpdateGroupMetadata({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupMetadata:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateGroupMetadata:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgSubmitProposal({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgSubmitProposal({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitProposal:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitProposal:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdateGroupPolicyDecisionPolicy({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgUpdateGroupPolicyDecisionPolicy({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupPolicyDecisionPolicy:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateGroupPolicyDecisionPolicy:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgExec({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgExec({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgExec:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgExec:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdateGroupAdmin({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgUpdateGroupAdmin({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupAdmin:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateGroupAdmin:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreateGroupWithPolicy({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgCreateGroupWithPolicy({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateGroupWithPolicy:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateGroupWithPolicy:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdateGroupMembers({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgUpdateGroupMembers({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupMembers:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateGroupMembers:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgWithdrawProposal({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgWithdrawProposal({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawProposal:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgWithdrawProposal:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdateGroupPolicyMetadata({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgUpdateGroupPolicyMetadata({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupPolicyMetadata:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateGroupPolicyMetadata:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgVote({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgVote({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVote:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVote:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreateGroupPolicy({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgCreateGroupPolicy({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateGroupPolicy:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateGroupPolicy:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdateGroupPolicyAdmin({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosGroupV1.tx.sendMsgUpdateGroupPolicyAdmin({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupPolicyAdmin:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateGroupPolicyAdmin:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgCreateGroup({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgCreateGroup({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateGroup:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreateGroup:Create Could not create message: ' + e.message) - } - } - }, - async MsgLeaveGroup({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgLeaveGroup({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgLeaveGroup:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgLeaveGroup:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdateGroupMetadata({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgUpdateGroupMetadata({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupMetadata:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateGroupMetadata:Create Could not create message: ' + e.message) - } - } - }, - async MsgSubmitProposal({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgSubmitProposal({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitProposal:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitProposal:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdateGroupPolicyDecisionPolicy({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgUpdateGroupPolicyDecisionPolicy({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupPolicyDecisionPolicy:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateGroupPolicyDecisionPolicy:Create Could not create message: ' + e.message) - } - } - }, - async MsgExec({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgExec({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgExec:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgExec:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdateGroupAdmin({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgUpdateGroupAdmin({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupAdmin:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateGroupAdmin:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreateGroupWithPolicy({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgCreateGroupWithPolicy({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateGroupWithPolicy:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreateGroupWithPolicy:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdateGroupMembers({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgUpdateGroupMembers({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupMembers:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateGroupMembers:Create Could not create message: ' + e.message) - } - } - }, - async MsgWithdrawProposal({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgWithdrawProposal({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawProposal:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgWithdrawProposal:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdateGroupPolicyMetadata({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgUpdateGroupPolicyMetadata({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupPolicyMetadata:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateGroupPolicyMetadata:Create Could not create message: ' + e.message) - } - } - }, - async MsgVote({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgVote({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVote:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgVote:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreateGroupPolicy({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgCreateGroupPolicy({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateGroupPolicy:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreateGroupPolicy:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdateGroupPolicyAdmin({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosGroupV1.tx.msgUpdateGroupPolicyAdmin({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateGroupPolicyAdmin:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateGroupPolicyAdmin:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.mint.v1beta1/index.ts b/vue/src/store/generated/cosmos.mint.v1beta1/index.ts deleted file mode 100755 index 96701f21..00000000 --- a/vue/src/store/generated/cosmos.mint.v1beta1/index.ts +++ /dev/null @@ -1,194 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Minter } from "fairyring-client-ts/cosmos.mint.v1beta1/types" -import { Params } from "fairyring-client-ts/cosmos.mint.v1beta1/types" - - -export { Minter, Params }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - Inflation: {}, - AnnualProvisions: {}, - - _Structure: { - Minter: getStructure(Minter.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getInflation: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Inflation[JSON.stringify(params)] ?? {} - }, - getAnnualProvisions: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AnnualProvisions[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.mint.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosMintV1Beta1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryInflation({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosMintV1Beta1.query.queryInflation()).data - - - commit('QUERY', { query: 'Inflation', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryInflation', payload: { options: { all }, params: {...key},query }}) - return getters['getInflation']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryInflation API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAnnualProvisions({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosMintV1Beta1.query.queryAnnualProvisions()).data - - - commit('QUERY', { query: 'AnnualProvisions', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAnnualProvisions', payload: { options: { all }, params: {...key},query }}) - return getters['getAnnualProvisions']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAnnualProvisions API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.nft.v1beta1/index.ts b/vue/src/store/generated/cosmos.nft.v1beta1/index.ts deleted file mode 100755 index 63ce5697..00000000 --- a/vue/src/store/generated/cosmos.nft.v1beta1/index.ts +++ /dev/null @@ -1,326 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { EventSend } from "fairyring-client-ts/cosmos.nft.v1beta1/types" -import { EventMint } from "fairyring-client-ts/cosmos.nft.v1beta1/types" -import { EventBurn } from "fairyring-client-ts/cosmos.nft.v1beta1/types" -import { Entry } from "fairyring-client-ts/cosmos.nft.v1beta1/types" -import { Class } from "fairyring-client-ts/cosmos.nft.v1beta1/types" -import { NFT } from "fairyring-client-ts/cosmos.nft.v1beta1/types" - - -export { EventSend, EventMint, EventBurn, Entry, Class, NFT }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Balance: {}, - Owner: {}, - Supply: {}, - NFTs: {}, - NFT: {}, - Class: {}, - Classes: {}, - - _Structure: { - EventSend: getStructure(EventSend.fromPartial({})), - EventMint: getStructure(EventMint.fromPartial({})), - EventBurn: getStructure(EventBurn.fromPartial({})), - Entry: getStructure(Entry.fromPartial({})), - Class: getStructure(Class.fromPartial({})), - NFT: getStructure(NFT.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getBalance: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Balance[JSON.stringify(params)] ?? {} - }, - getOwner: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Owner[JSON.stringify(params)] ?? {} - }, - getSupply: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Supply[JSON.stringify(params)] ?? {} - }, - getNFTs: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.NFTs[JSON.stringify(params)] ?? {} - }, - getNFT: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.NFT[JSON.stringify(params)] ?? {} - }, - getClass: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Class[JSON.stringify(params)] ?? {} - }, - getClasses: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Classes[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.nft.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryBalance({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosNftV1Beta1.query.queryBalance( key.owner, key.class_id)).data - - - commit('QUERY', { query: 'Balance', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryBalance', payload: { options: { all }, params: {...key},query }}) - return getters['getBalance']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryBalance API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryOwner({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosNftV1Beta1.query.queryOwner( key.class_id, key.id)).data - - - commit('QUERY', { query: 'Owner', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryOwner', payload: { options: { all }, params: {...key},query }}) - return getters['getOwner']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryOwner API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySupply({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosNftV1Beta1.query.querySupply( key.class_id)).data - - - commit('QUERY', { query: 'Supply', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySupply', payload: { options: { all }, params: {...key},query }}) - return getters['getSupply']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySupply API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryNFTs({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosNftV1Beta1.query.queryNFTs(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosNftV1Beta1.query.queryNFTs({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'NFTs', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryNFTs', payload: { options: { all }, params: {...key},query }}) - return getters['getNFTs']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryNFTs API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryNFT({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosNftV1Beta1.query.queryNFT( key.class_id, key.id)).data - - - commit('QUERY', { query: 'NFT', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryNFT', payload: { options: { all }, params: {...key},query }}) - return getters['getNFT']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryNFT API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClass({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosNftV1Beta1.query.queryClass( key.class_id)).data - - - commit('QUERY', { query: 'Class', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClass', payload: { options: { all }, params: {...key},query }}) - return getters['getClass']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClass API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClasses({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosNftV1Beta1.query.queryClasses(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosNftV1Beta1.query.queryClasses({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Classes', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClasses', payload: { options: { all }, params: {...key},query }}) - return getters['getClasses']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClasses API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.params.v1beta1/index.ts b/vue/src/store/generated/cosmos.params.v1beta1/index.ts deleted file mode 100755 index a5f535d7..00000000 --- a/vue/src/store/generated/cosmos.params.v1beta1/index.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { ParameterChangeProposal } from "fairyring-client-ts/cosmos.params.v1beta1/types" -import { ParamChange } from "fairyring-client-ts/cosmos.params.v1beta1/types" -import { Subspace } from "fairyring-client-ts/cosmos.params.v1beta1/types" - - -export { ParameterChangeProposal, ParamChange, Subspace }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - Subspaces: {}, - - _Structure: { - ParameterChangeProposal: getStructure(ParameterChangeProposal.fromPartial({})), - ParamChange: getStructure(ParamChange.fromPartial({})), - Subspace: getStructure(Subspace.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getSubspaces: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Subspaces[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.params.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosParamsV1Beta1.query.queryParams(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosParamsV1Beta1.query.queryParams({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySubspaces({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosParamsV1Beta1.query.querySubspaces()).data - - - commit('QUERY', { query: 'Subspaces', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySubspaces', payload: { options: { all }, params: {...key},query }}) - return getters['getSubspaces']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySubspaces API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.slashing.v1beta1/index.ts b/vue/src/store/generated/cosmos.slashing.v1beta1/index.ts deleted file mode 100755 index 21a8e3f1..00000000 --- a/vue/src/store/generated/cosmos.slashing.v1beta1/index.ts +++ /dev/null @@ -1,231 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { SigningInfo } from "fairyring-client-ts/cosmos.slashing.v1beta1/types" -import { ValidatorMissedBlocks } from "fairyring-client-ts/cosmos.slashing.v1beta1/types" -import { MissedBlock } from "fairyring-client-ts/cosmos.slashing.v1beta1/types" -import { ValidatorSigningInfo } from "fairyring-client-ts/cosmos.slashing.v1beta1/types" -import { Params } from "fairyring-client-ts/cosmos.slashing.v1beta1/types" - - -export { SigningInfo, ValidatorMissedBlocks, MissedBlock, ValidatorSigningInfo, Params }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - SigningInfo: {}, - SigningInfos: {}, - - _Structure: { - SigningInfo: getStructure(SigningInfo.fromPartial({})), - ValidatorMissedBlocks: getStructure(ValidatorMissedBlocks.fromPartial({})), - MissedBlock: getStructure(MissedBlock.fromPartial({})), - ValidatorSigningInfo: getStructure(ValidatorSigningInfo.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getSigningInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.SigningInfo[JSON.stringify(params)] ?? {} - }, - getSigningInfos: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.SigningInfos[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.slashing.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosSlashingV1Beta1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySigningInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosSlashingV1Beta1.query.querySigningInfo( key.cons_address)).data - - - commit('QUERY', { query: 'SigningInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySigningInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getSigningInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySigningInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySigningInfos({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosSlashingV1Beta1.query.querySigningInfos(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosSlashingV1Beta1.query.querySigningInfos({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'SigningInfos', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySigningInfos', payload: { options: { all }, params: {...key},query }}) - return getters['getSigningInfos']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySigningInfos API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgUnjail({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosSlashingV1Beta1.tx.sendMsgUnjail({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUnjail:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUnjail:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgUnjail({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosSlashingV1Beta1.tx.msgUnjail({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUnjail:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUnjail:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.staking.v1beta1/index.ts b/vue/src/store/generated/cosmos.staking.v1beta1/index.ts deleted file mode 100755 index 1363dde3..00000000 --- a/vue/src/store/generated/cosmos.staking.v1beta1/index.ts +++ /dev/null @@ -1,747 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { StakeAuthorization } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { StakeAuthorization_Validators } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { LastValidatorPower } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { HistoricalInfo } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { CommissionRates } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { Commission } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { Description } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { Validator } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { ValAddresses } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { DVPair } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { DVPairs } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { DVVTriplet } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { DVVTriplets } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { Delegation } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { UnbondingDelegation } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { UnbondingDelegationEntry } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { RedelegationEntry } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { Redelegation } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { Params } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { DelegationResponse } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { RedelegationEntryResponse } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { RedelegationResponse } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { Pool } from "fairyring-client-ts/cosmos.staking.v1beta1/types" -import { ValidatorUpdates } from "fairyring-client-ts/cosmos.staking.v1beta1/types" - - -export { StakeAuthorization, StakeAuthorization_Validators, LastValidatorPower, HistoricalInfo, CommissionRates, Commission, Description, Validator, ValAddresses, DVPair, DVPairs, DVVTriplet, DVVTriplets, Delegation, UnbondingDelegation, UnbondingDelegationEntry, RedelegationEntry, Redelegation, Params, DelegationResponse, RedelegationEntryResponse, RedelegationResponse, Pool, ValidatorUpdates }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Validators: {}, - Validator: {}, - ValidatorDelegations: {}, - ValidatorUnbondingDelegations: {}, - Delegation: {}, - UnbondingDelegation: {}, - DelegatorDelegations: {}, - DelegatorUnbondingDelegations: {}, - Redelegations: {}, - DelegatorValidators: {}, - DelegatorValidator: {}, - HistoricalInfo: {}, - Pool: {}, - Params: {}, - - _Structure: { - StakeAuthorization: getStructure(StakeAuthorization.fromPartial({})), - StakeAuthorization_Validators: getStructure(StakeAuthorization_Validators.fromPartial({})), - LastValidatorPower: getStructure(LastValidatorPower.fromPartial({})), - HistoricalInfo: getStructure(HistoricalInfo.fromPartial({})), - CommissionRates: getStructure(CommissionRates.fromPartial({})), - Commission: getStructure(Commission.fromPartial({})), - Description: getStructure(Description.fromPartial({})), - Validator: getStructure(Validator.fromPartial({})), - ValAddresses: getStructure(ValAddresses.fromPartial({})), - DVPair: getStructure(DVPair.fromPartial({})), - DVPairs: getStructure(DVPairs.fromPartial({})), - DVVTriplet: getStructure(DVVTriplet.fromPartial({})), - DVVTriplets: getStructure(DVVTriplets.fromPartial({})), - Delegation: getStructure(Delegation.fromPartial({})), - UnbondingDelegation: getStructure(UnbondingDelegation.fromPartial({})), - UnbondingDelegationEntry: getStructure(UnbondingDelegationEntry.fromPartial({})), - RedelegationEntry: getStructure(RedelegationEntry.fromPartial({})), - Redelegation: getStructure(Redelegation.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - DelegationResponse: getStructure(DelegationResponse.fromPartial({})), - RedelegationEntryResponse: getStructure(RedelegationEntryResponse.fromPartial({})), - RedelegationResponse: getStructure(RedelegationResponse.fromPartial({})), - Pool: getStructure(Pool.fromPartial({})), - ValidatorUpdates: getStructure(ValidatorUpdates.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getValidators: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Validators[JSON.stringify(params)] ?? {} - }, - getValidator: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Validator[JSON.stringify(params)] ?? {} - }, - getValidatorDelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorDelegations[JSON.stringify(params)] ?? {} - }, - getValidatorUnbondingDelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorUnbondingDelegations[JSON.stringify(params)] ?? {} - }, - getDelegation: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Delegation[JSON.stringify(params)] ?? {} - }, - getUnbondingDelegation: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UnbondingDelegation[JSON.stringify(params)] ?? {} - }, - getDelegatorDelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorDelegations[JSON.stringify(params)] ?? {} - }, - getDelegatorUnbondingDelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorUnbondingDelegations[JSON.stringify(params)] ?? {} - }, - getRedelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Redelegations[JSON.stringify(params)] ?? {} - }, - getDelegatorValidators: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorValidators[JSON.stringify(params)] ?? {} - }, - getDelegatorValidator: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorValidator[JSON.stringify(params)] ?? {} - }, - getHistoricalInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.HistoricalInfo[JSON.stringify(params)] ?? {} - }, - getPool: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Pool[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.staking.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryValidators({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryValidators(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosStakingV1Beta1.query.queryValidators({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Validators', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidators', payload: { options: { all }, params: {...key},query }}) - return getters['getValidators']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidators API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidator({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryValidator( key.validator_addr)).data - - - commit('QUERY', { query: 'Validator', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidator', payload: { options: { all }, params: {...key},query }}) - return getters['getValidator']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidator API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorDelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryValidatorDelegations( key.validator_addr, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosStakingV1Beta1.query.queryValidatorDelegations( key.validator_addr, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ValidatorDelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorDelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorDelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorDelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorUnbondingDelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryValidatorUnbondingDelegations( key.validator_addr, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosStakingV1Beta1.query.queryValidatorUnbondingDelegations( key.validator_addr, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ValidatorUnbondingDelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorUnbondingDelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorUnbondingDelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorUnbondingDelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegation({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryDelegation( key.validator_addr, key.delegator_addr)).data - - - commit('QUERY', { query: 'Delegation', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegation', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegation']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegation API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUnbondingDelegation({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryUnbondingDelegation( key.validator_addr, key.delegator_addr)).data - - - commit('QUERY', { query: 'UnbondingDelegation', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUnbondingDelegation', payload: { options: { all }, params: {...key},query }}) - return getters['getUnbondingDelegation']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUnbondingDelegation API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorDelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryDelegatorDelegations( key.delegator_addr, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosStakingV1Beta1.query.queryDelegatorDelegations( key.delegator_addr, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DelegatorDelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorDelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorDelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorDelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorUnbondingDelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryDelegatorUnbondingDelegations( key.delegator_addr, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosStakingV1Beta1.query.queryDelegatorUnbondingDelegations( key.delegator_addr, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DelegatorUnbondingDelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorUnbondingDelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorUnbondingDelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorUnbondingDelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryRedelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryRedelegations( key.delegator_addr, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosStakingV1Beta1.query.queryRedelegations( key.delegator_addr, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Redelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryRedelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getRedelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryRedelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorValidators({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryDelegatorValidators( key.delegator_addr, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosStakingV1Beta1.query.queryDelegatorValidators( key.delegator_addr, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DelegatorValidators', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorValidators', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorValidators']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorValidators API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorValidator({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryDelegatorValidator( key.delegator_addr, key.validator_addr)).data - - - commit('QUERY', { query: 'DelegatorValidator', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorValidator', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorValidator']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorValidator API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryHistoricalInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryHistoricalInfo( key.height)).data - - - commit('QUERY', { query: 'HistoricalInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryHistoricalInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getHistoricalInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryHistoricalInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPool({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryPool()).data - - - commit('QUERY', { query: 'Pool', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPool', payload: { options: { all }, params: {...key},query }}) - return getters['getPool']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPool API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosStakingV1Beta1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgEditValidator({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosStakingV1Beta1.tx.sendMsgEditValidator({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgEditValidator:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgEditValidator:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgDelegate({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosStakingV1Beta1.tx.sendMsgDelegate({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDelegate:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgDelegate:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgBeginRedelegate({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosStakingV1Beta1.tx.sendMsgBeginRedelegate({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgBeginRedelegate:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgBeginRedelegate:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUndelegate({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosStakingV1Beta1.tx.sendMsgUndelegate({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUndelegate:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUndelegate:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreateValidator({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosStakingV1Beta1.tx.sendMsgCreateValidator({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateValidator:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateValidator:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCancelUnbondingDelegation({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosStakingV1Beta1.tx.sendMsgCancelUnbondingDelegation({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCancelUnbondingDelegation:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCancelUnbondingDelegation:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgEditValidator({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosStakingV1Beta1.tx.msgEditValidator({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgEditValidator:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgEditValidator:Create Could not create message: ' + e.message) - } - } - }, - async MsgDelegate({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosStakingV1Beta1.tx.msgDelegate({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDelegate:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgDelegate:Create Could not create message: ' + e.message) - } - } - }, - async MsgBeginRedelegate({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosStakingV1Beta1.tx.msgBeginRedelegate({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgBeginRedelegate:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgBeginRedelegate:Create Could not create message: ' + e.message) - } - } - }, - async MsgUndelegate({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosStakingV1Beta1.tx.msgUndelegate({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUndelegate:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUndelegate:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreateValidator({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosStakingV1Beta1.tx.msgCreateValidator({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateValidator:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreateValidator:Create Could not create message: ' + e.message) - } - } - }, - async MsgCancelUnbondingDelegation({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosStakingV1Beta1.tx.msgCancelUnbondingDelegation({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCancelUnbondingDelegation:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCancelUnbondingDelegation:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.tx.v1beta1/index.ts b/vue/src/store/generated/cosmos.tx.v1beta1/index.ts deleted file mode 100755 index 27dbf59b..00000000 --- a/vue/src/store/generated/cosmos.tx.v1beta1/index.ts +++ /dev/null @@ -1,398 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Tx } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { TxRaw } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { SignDoc } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { SignDocDirectAux } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { TxBody } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { AuthInfo } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { SignerInfo } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { ModeInfo } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { ModeInfo_Single } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { ModeInfo_Multi } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { Fee } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { Tip } from "fairyring-client-ts/cosmos.tx.v1beta1/types" -import { AuxSignerData } from "fairyring-client-ts/cosmos.tx.v1beta1/types" - - -export { Tx, TxRaw, SignDoc, SignDocDirectAux, TxBody, AuthInfo, SignerInfo, ModeInfo, ModeInfo_Single, ModeInfo_Multi, Fee, Tip, AuxSignerData }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Simulate: {}, - GetTx: {}, - BroadcastTx: {}, - GetTxsEvent: {}, - GetBlockWithTxs: {}, - TxDecode: {}, - TxEncode: {}, - TxEncodeAmino: {}, - TxDecodeAmino: {}, - - _Structure: { - Tx: getStructure(Tx.fromPartial({})), - TxRaw: getStructure(TxRaw.fromPartial({})), - SignDoc: getStructure(SignDoc.fromPartial({})), - SignDocDirectAux: getStructure(SignDocDirectAux.fromPartial({})), - TxBody: getStructure(TxBody.fromPartial({})), - AuthInfo: getStructure(AuthInfo.fromPartial({})), - SignerInfo: getStructure(SignerInfo.fromPartial({})), - ModeInfo: getStructure(ModeInfo.fromPartial({})), - ModeInfo_Single: getStructure(ModeInfo_Single.fromPartial({})), - ModeInfo_Multi: getStructure(ModeInfo_Multi.fromPartial({})), - Fee: getStructure(Fee.fromPartial({})), - Tip: getStructure(Tip.fromPartial({})), - AuxSignerData: getStructure(AuxSignerData.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getSimulate: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Simulate[JSON.stringify(params)] ?? {} - }, - getGetTx: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetTx[JSON.stringify(params)] ?? {} - }, - getBroadcastTx: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.BroadcastTx[JSON.stringify(params)] ?? {} - }, - getGetTxsEvent: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetTxsEvent[JSON.stringify(params)] ?? {} - }, - getGetBlockWithTxs: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetBlockWithTxs[JSON.stringify(params)] ?? {} - }, - getTxDecode: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TxDecode[JSON.stringify(params)] ?? {} - }, - getTxEncode: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TxEncode[JSON.stringify(params)] ?? {} - }, - getTxEncodeAmino: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TxEncodeAmino[JSON.stringify(params)] ?? {} - }, - getTxDecodeAmino: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TxDecodeAmino[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.tx.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async ServiceSimulate({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosTxV1Beta1.query.serviceSimulate({...key})).data - - - commit('QUERY', { query: 'Simulate', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceSimulate', payload: { options: { all }, params: {...key},query }}) - return getters['getSimulate']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceSimulate API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetTx({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosTxV1Beta1.query.serviceGetTx( key.hash)).data - - - commit('QUERY', { query: 'GetTx', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetTx', payload: { options: { all }, params: {...key},query }}) - return getters['getGetTx']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetTx API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceBroadcastTx({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosTxV1Beta1.query.serviceBroadcastTx({...key})).data - - - commit('QUERY', { query: 'BroadcastTx', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceBroadcastTx', payload: { options: { all }, params: {...key},query }}) - return getters['getBroadcastTx']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceBroadcastTx API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetTxsEvent({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosTxV1Beta1.query.serviceGetTxsEvent(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosTxV1Beta1.query.serviceGetTxsEvent({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GetTxsEvent', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetTxsEvent', payload: { options: { all }, params: {...key},query }}) - return getters['getGetTxsEvent']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetTxsEvent API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetBlockWithTxs({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosTxV1Beta1.query.serviceGetBlockWithTxs( key.height, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosTxV1Beta1.query.serviceGetBlockWithTxs( key.height, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GetBlockWithTxs', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetBlockWithTxs', payload: { options: { all }, params: {...key},query }}) - return getters['getGetBlockWithTxs']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetBlockWithTxs API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceTxDecode({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosTxV1Beta1.query.serviceTxDecode({...key})).data - - - commit('QUERY', { query: 'TxDecode', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceTxDecode', payload: { options: { all }, params: {...key},query }}) - return getters['getTxDecode']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceTxDecode API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceTxEncode({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosTxV1Beta1.query.serviceTxEncode({...key})).data - - - commit('QUERY', { query: 'TxEncode', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceTxEncode', payload: { options: { all }, params: {...key},query }}) - return getters['getTxEncode']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceTxEncode API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceTxEncodeAmino({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosTxV1Beta1.query.serviceTxEncodeAmino({...key})).data - - - commit('QUERY', { query: 'TxEncodeAmino', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceTxEncodeAmino', payload: { options: { all }, params: {...key},query }}) - return getters['getTxEncodeAmino']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceTxEncodeAmino API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceTxDecodeAmino({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosTxV1Beta1.query.serviceTxDecodeAmino({...key})).data - - - commit('QUERY', { query: 'TxDecodeAmino', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceTxDecodeAmino', payload: { options: { all }, params: {...key},query }}) - return getters['getTxDecodeAmino']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceTxDecodeAmino API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.upgrade.v1beta1/index.ts b/vue/src/store/generated/cosmos.upgrade.v1beta1/index.ts deleted file mode 100755 index 0398966b..00000000 --- a/vue/src/store/generated/cosmos.upgrade.v1beta1/index.ts +++ /dev/null @@ -1,314 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Plan } from "fairyring-client-ts/cosmos.upgrade.v1beta1/types" -import { SoftwareUpgradeProposal } from "fairyring-client-ts/cosmos.upgrade.v1beta1/types" -import { CancelSoftwareUpgradeProposal } from "fairyring-client-ts/cosmos.upgrade.v1beta1/types" -import { ModuleVersion } from "fairyring-client-ts/cosmos.upgrade.v1beta1/types" - - -export { Plan, SoftwareUpgradeProposal, CancelSoftwareUpgradeProposal, ModuleVersion }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - CurrentPlan: {}, - AppliedPlan: {}, - UpgradedConsensusState: {}, - ModuleVersions: {}, - Authority: {}, - - _Structure: { - Plan: getStructure(Plan.fromPartial({})), - SoftwareUpgradeProposal: getStructure(SoftwareUpgradeProposal.fromPartial({})), - CancelSoftwareUpgradeProposal: getStructure(CancelSoftwareUpgradeProposal.fromPartial({})), - ModuleVersion: getStructure(ModuleVersion.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getCurrentPlan: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.CurrentPlan[JSON.stringify(params)] ?? {} - }, - getAppliedPlan: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AppliedPlan[JSON.stringify(params)] ?? {} - }, - getUpgradedConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UpgradedConsensusState[JSON.stringify(params)] ?? {} - }, - getModuleVersions: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ModuleVersions[JSON.stringify(params)] ?? {} - }, - getAuthority: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Authority[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.upgrade.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryCurrentPlan({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosUpgradeV1Beta1.query.queryCurrentPlan()).data - - - commit('QUERY', { query: 'CurrentPlan', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryCurrentPlan', payload: { options: { all }, params: {...key},query }}) - return getters['getCurrentPlan']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryCurrentPlan API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAppliedPlan({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosUpgradeV1Beta1.query.queryAppliedPlan( key.name)).data - - - commit('QUERY', { query: 'AppliedPlan', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAppliedPlan', payload: { options: { all }, params: {...key},query }}) - return getters['getAppliedPlan']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAppliedPlan API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUpgradedConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosUpgradeV1Beta1.query.queryUpgradedConsensusState( key.last_height)).data - - - commit('QUERY', { query: 'UpgradedConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUpgradedConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getUpgradedConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUpgradedConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryModuleVersions({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosUpgradeV1Beta1.query.queryModuleVersions(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.CosmosUpgradeV1Beta1.query.queryModuleVersions({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ModuleVersions', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryModuleVersions', payload: { options: { all }, params: {...key},query }}) - return getters['getModuleVersions']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryModuleVersions API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAuthority({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.CosmosUpgradeV1Beta1.query.queryAuthority()).data - - - commit('QUERY', { query: 'Authority', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAuthority', payload: { options: { all }, params: {...key},query }}) - return getters['getAuthority']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAuthority API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgCancelUpgrade({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosUpgradeV1Beta1.tx.sendMsgCancelUpgrade({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCancelUpgrade:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCancelUpgrade:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgSoftwareUpgrade({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosUpgradeV1Beta1.tx.sendMsgSoftwareUpgrade({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSoftwareUpgrade:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSoftwareUpgrade:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgCancelUpgrade({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosUpgradeV1Beta1.tx.msgCancelUpgrade({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCancelUpgrade:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCancelUpgrade:Create Could not create message: ' + e.message) - } - } - }, - async MsgSoftwareUpgrade({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosUpgradeV1Beta1.tx.msgSoftwareUpgrade({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSoftwareUpgrade:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSoftwareUpgrade:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos.vesting.v1beta1/index.ts b/vue/src/store/generated/cosmos.vesting.v1beta1/index.ts deleted file mode 100755 index 464a39fd..00000000 --- a/vue/src/store/generated/cosmos.vesting.v1beta1/index.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { BaseVestingAccount } from "fairyring-client-ts/cosmos.vesting.v1beta1/types" -import { ContinuousVestingAccount } from "fairyring-client-ts/cosmos.vesting.v1beta1/types" -import { DelayedVestingAccount } from "fairyring-client-ts/cosmos.vesting.v1beta1/types" -import { Period } from "fairyring-client-ts/cosmos.vesting.v1beta1/types" -import { PeriodicVestingAccount } from "fairyring-client-ts/cosmos.vesting.v1beta1/types" -import { PermanentLockedAccount } from "fairyring-client-ts/cosmos.vesting.v1beta1/types" - - -export { BaseVestingAccount, ContinuousVestingAccount, DelayedVestingAccount, Period, PeriodicVestingAccount, PermanentLockedAccount }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - - _Structure: { - BaseVestingAccount: getStructure(BaseVestingAccount.fromPartial({})), - ContinuousVestingAccount: getStructure(ContinuousVestingAccount.fromPartial({})), - DelayedVestingAccount: getStructure(DelayedVestingAccount.fromPartial({})), - Period: getStructure(Period.fromPartial({})), - PeriodicVestingAccount: getStructure(PeriodicVestingAccount.fromPartial({})), - PermanentLockedAccount: getStructure(PermanentLockedAccount.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.vesting.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - async sendMsgCreateVestingAccount({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosVestingV1Beta1.tx.sendMsgCreateVestingAccount({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateVestingAccount:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateVestingAccount:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreatePermanentLockedAccount({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosVestingV1Beta1.tx.sendMsgCreatePermanentLockedAccount({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreatePermanentLockedAccount:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreatePermanentLockedAccount:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreatePeriodicVestingAccount({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.CosmosVestingV1Beta1.tx.sendMsgCreatePeriodicVestingAccount({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreatePeriodicVestingAccount:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreatePeriodicVestingAccount:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgCreateVestingAccount({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosVestingV1Beta1.tx.msgCreateVestingAccount({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateVestingAccount:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreateVestingAccount:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreatePermanentLockedAccount({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosVestingV1Beta1.tx.msgCreatePermanentLockedAccount({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreatePermanentLockedAccount:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreatePermanentLockedAccount:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreatePeriodicVestingAccount({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.CosmosVestingV1Beta1.tx.msgCreatePeriodicVestingAccount({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreatePeriodicVestingAccount:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreatePeriodicVestingAccount:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/index.ts deleted file mode 100644 index a879a2de..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/index.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { BaseAccount } from "./module/types/cosmos/auth/v1beta1/auth" -import { ModuleAccount } from "./module/types/cosmos/auth/v1beta1/auth" -import { Params } from "./module/types/cosmos/auth/v1beta1/auth" - - -export { BaseAccount, ModuleAccount, Params }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Accounts: {}, - Account: {}, - Params: {}, - - _Structure: { - BaseAccount: getStructure(BaseAccount.fromPartial({})), - ModuleAccount: getStructure(ModuleAccount.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getAccounts: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Accounts[JSON.stringify(params)] ?? {} - }, - getAccount: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Account[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.auth.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryAccounts({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryAccounts(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryAccounts({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Accounts', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAccounts', payload: { options: { all }, params: {...key},query }}) - return getters['getAccounts']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAccounts API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAccount({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryAccount( key.address)).data - - - commit('QUERY', { query: 'Account', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAccount', payload: { options: { all }, params: {...key},query }}) - return getters['getAccount']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAccount API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/rest.ts deleted file mode 100644 index 95a734fd..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/rest.ts +++ /dev/null @@ -1,500 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * Params defines the parameters for the auth module. - */ -export interface V1Beta1Params { - /** @format uint64 */ - max_memo_characters?: string; - - /** @format uint64 */ - tx_sig_limit?: string; - - /** @format uint64 */ - tx_size_cost_per_byte?: string; - - /** @format uint64 */ - sig_verify_cost_ed25519?: string; - - /** @format uint64 */ - sig_verify_cost_secp256k1?: string; -} - -/** - * QueryAccountResponse is the response type for the Query/Account RPC method. - */ -export interface V1Beta1QueryAccountResponse { - /** account defines the account of the corresponding address. */ - account?: ProtobufAny; -} - -/** -* QueryAccountsResponse is the response type for the Query/Accounts RPC method. - -Since: cosmos-sdk 0.43 -*/ -export interface V1Beta1QueryAccountsResponse { - accounts?: ProtobufAny[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * QueryParamsResponse is the response type for the Query/Params RPC method. - */ -export interface V1Beta1QueryParamsResponse { - /** params defines the parameters of the module. */ - params?: V1Beta1Params; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/auth/v1beta1/auth.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * @description Since: cosmos-sdk 0.43 - * - * @tags Query - * @name QueryAccounts - * @summary Accounts returns all the existing accounts - * @request GET:/cosmos/auth/v1beta1/accounts - */ - queryAccounts = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/auth/v1beta1/accounts`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryAccount - * @summary Account returns account details based on address. - * @request GET:/cosmos/auth/v1beta1/accounts/{address} - */ - queryAccount = (address: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/auth/v1beta1/accounts/${address}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryParams - * @summary Params queries all parameters. - * @request GET:/cosmos/auth/v1beta1/params - */ - queryParams = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/auth/v1beta1/params`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/auth/v1beta1/auth.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/auth/v1beta1/auth.ts deleted file mode 100644 index c7448a25..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/auth/v1beta1/auth.ts +++ /dev/null @@ -1,441 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; - -export const protobufPackage = "cosmos.auth.v1beta1"; - -/** - * BaseAccount defines a base account type. It contains all the necessary fields - * for basic account functionality. Any custom account type should extend this - * type for additional functionality (e.g. vesting). - */ -export interface BaseAccount { - address: string; - pub_key: Any | undefined; - account_number: number; - sequence: number; -} - -/** ModuleAccount defines an account for modules that holds coins on a pool. */ -export interface ModuleAccount { - base_account: BaseAccount | undefined; - name: string; - permissions: string[]; -} - -/** Params defines the parameters for the auth module. */ -export interface Params { - max_memo_characters: number; - tx_sig_limit: number; - tx_size_cost_per_byte: number; - sig_verify_cost_ed25519: number; - sig_verify_cost_secp256k1: number; -} - -const baseBaseAccount: object = { address: "", account_number: 0, sequence: 0 }; - -export const BaseAccount = { - encode(message: BaseAccount, writer: Writer = Writer.create()): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.pub_key !== undefined) { - Any.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); - } - if (message.account_number !== 0) { - writer.uint32(24).uint64(message.account_number); - } - if (message.sequence !== 0) { - writer.uint32(32).uint64(message.sequence); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BaseAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBaseAccount } as BaseAccount; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.pub_key = Any.decode(reader, reader.uint32()); - break; - case 3: - message.account_number = longToNumber(reader.uint64() as Long); - break; - case 4: - message.sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BaseAccount { - const message = { ...baseBaseAccount } as BaseAccount; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = Number(object.account_number); - } else { - message.account_number = 0; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; - }, - - toJSON(message: BaseAccount): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key ? Any.toJSON(message.pub_key) : undefined); - message.account_number !== undefined && - (obj.account_number = message.account_number); - message.sequence !== undefined && (obj.sequence = message.sequence); - return obj; - }, - - fromPartial(object: DeepPartial): BaseAccount { - const message = { ...baseBaseAccount } as BaseAccount; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = object.account_number; - } else { - message.account_number = 0; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - return message; - }, -}; - -const baseModuleAccount: object = { name: "", permissions: "" }; - -export const ModuleAccount = { - encode(message: ModuleAccount, writer: Writer = Writer.create()): Writer { - if (message.base_account !== undefined) { - BaseAccount.encode( - message.base_account, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.name !== "") { - writer.uint32(18).string(message.name); - } - for (const v of message.permissions) { - writer.uint32(26).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ModuleAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_account = BaseAccount.decode(reader, reader.uint32()); - break; - case 2: - message.name = reader.string(); - break; - case 3: - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ModuleAccount { - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromJSON(object.base_account); - } else { - message.base_account = undefined; - } - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.permissions !== undefined && object.permissions !== null) { - for (const e of object.permissions) { - message.permissions.push(String(e)); - } - } - return message; - }, - - toJSON(message: ModuleAccount): unknown { - const obj: any = {}; - message.base_account !== undefined && - (obj.base_account = message.base_account - ? BaseAccount.toJSON(message.base_account) - : undefined); - message.name !== undefined && (obj.name = message.name); - if (message.permissions) { - obj.permissions = message.permissions.map((e) => e); - } else { - obj.permissions = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ModuleAccount { - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromPartial(object.base_account); - } else { - message.base_account = undefined; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.permissions !== undefined && object.permissions !== null) { - for (const e of object.permissions) { - message.permissions.push(e); - } - } - return message; - }, -}; - -const baseParams: object = { - max_memo_characters: 0, - tx_sig_limit: 0, - tx_size_cost_per_byte: 0, - sig_verify_cost_ed25519: 0, - sig_verify_cost_secp256k1: 0, -}; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.max_memo_characters !== 0) { - writer.uint32(8).uint64(message.max_memo_characters); - } - if (message.tx_sig_limit !== 0) { - writer.uint32(16).uint64(message.tx_sig_limit); - } - if (message.tx_size_cost_per_byte !== 0) { - writer.uint32(24).uint64(message.tx_size_cost_per_byte); - } - if (message.sig_verify_cost_ed25519 !== 0) { - writer.uint32(32).uint64(message.sig_verify_cost_ed25519); - } - if (message.sig_verify_cost_secp256k1 !== 0) { - writer.uint32(40).uint64(message.sig_verify_cost_secp256k1); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_memo_characters = longToNumber(reader.uint64() as Long); - break; - case 2: - message.tx_sig_limit = longToNumber(reader.uint64() as Long); - break; - case 3: - message.tx_size_cost_per_byte = longToNumber(reader.uint64() as Long); - break; - case 4: - message.sig_verify_cost_ed25519 = longToNumber( - reader.uint64() as Long - ); - break; - case 5: - message.sig_verify_cost_secp256k1 = longToNumber( - reader.uint64() as Long - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if ( - object.max_memo_characters !== undefined && - object.max_memo_characters !== null - ) { - message.max_memo_characters = Number(object.max_memo_characters); - } else { - message.max_memo_characters = 0; - } - if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { - message.tx_sig_limit = Number(object.tx_sig_limit); - } else { - message.tx_sig_limit = 0; - } - if ( - object.tx_size_cost_per_byte !== undefined && - object.tx_size_cost_per_byte !== null - ) { - message.tx_size_cost_per_byte = Number(object.tx_size_cost_per_byte); - } else { - message.tx_size_cost_per_byte = 0; - } - if ( - object.sig_verify_cost_ed25519 !== undefined && - object.sig_verify_cost_ed25519 !== null - ) { - message.sig_verify_cost_ed25519 = Number(object.sig_verify_cost_ed25519); - } else { - message.sig_verify_cost_ed25519 = 0; - } - if ( - object.sig_verify_cost_secp256k1 !== undefined && - object.sig_verify_cost_secp256k1 !== null - ) { - message.sig_verify_cost_secp256k1 = Number( - object.sig_verify_cost_secp256k1 - ); - } else { - message.sig_verify_cost_secp256k1 = 0; - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.max_memo_characters !== undefined && - (obj.max_memo_characters = message.max_memo_characters); - message.tx_sig_limit !== undefined && - (obj.tx_sig_limit = message.tx_sig_limit); - message.tx_size_cost_per_byte !== undefined && - (obj.tx_size_cost_per_byte = message.tx_size_cost_per_byte); - message.sig_verify_cost_ed25519 !== undefined && - (obj.sig_verify_cost_ed25519 = message.sig_verify_cost_ed25519); - message.sig_verify_cost_secp256k1 !== undefined && - (obj.sig_verify_cost_secp256k1 = message.sig_verify_cost_secp256k1); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if ( - object.max_memo_characters !== undefined && - object.max_memo_characters !== null - ) { - message.max_memo_characters = object.max_memo_characters; - } else { - message.max_memo_characters = 0; - } - if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { - message.tx_sig_limit = object.tx_sig_limit; - } else { - message.tx_sig_limit = 0; - } - if ( - object.tx_size_cost_per_byte !== undefined && - object.tx_size_cost_per_byte !== null - ) { - message.tx_size_cost_per_byte = object.tx_size_cost_per_byte; - } else { - message.tx_size_cost_per_byte = 0; - } - if ( - object.sig_verify_cost_ed25519 !== undefined && - object.sig_verify_cost_ed25519 !== null - ) { - message.sig_verify_cost_ed25519 = object.sig_verify_cost_ed25519; - } else { - message.sig_verify_cost_ed25519 = 0; - } - if ( - object.sig_verify_cost_secp256k1 !== undefined && - object.sig_verify_cost_secp256k1 !== null - ) { - message.sig_verify_cost_secp256k1 = object.sig_verify_cost_secp256k1; - } else { - message.sig_verify_cost_secp256k1 = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/auth/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/auth/v1beta1/genesis.ts deleted file mode 100644 index f4571bfd..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/auth/v1beta1/genesis.ts +++ /dev/null @@ -1,107 +0,0 @@ -/* eslint-disable */ -import { Params } from "../../../cosmos/auth/v1beta1/auth"; -import { Any } from "../../../google/protobuf/any"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.auth.v1beta1"; - -/** GenesisState defines the auth module's genesis state. */ -export interface GenesisState { - /** params defines all the paramaters of the module. */ - params: Params | undefined; - /** accounts are the accounts present at genesis. */ - accounts: Any[]; -} - -const baseGenesisState: object = {}; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.accounts) { - Any.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.accounts = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - case 2: - message.accounts.push(Any.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.accounts = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.accounts !== undefined && object.accounts !== null) { - for (const e of object.accounts) { - message.accounts.push(Any.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - if (message.accounts) { - obj.accounts = message.accounts.map((e) => - e ? Any.toJSON(e) : undefined - ); - } else { - obj.accounts = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.accounts = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.accounts !== undefined && object.accounts !== null) { - for (const e of object.accounts) { - message.accounts.push(Any.fromPartial(e)); - } - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/auth/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/auth/v1beta1/query.ts deleted file mode 100644 index dd00e200..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/auth/v1beta1/query.ts +++ /dev/null @@ -1,493 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; -import { Any } from "../../../google/protobuf/any"; -import { Params } from "../../../cosmos/auth/v1beta1/auth"; - -export const protobufPackage = "cosmos.auth.v1beta1"; - -/** - * QueryAccountsRequest is the request type for the Query/Accounts RPC method. - * - * Since: cosmos-sdk 0.43 - */ -export interface QueryAccountsRequest { - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryAccountsResponse is the response type for the Query/Accounts RPC method. - * - * Since: cosmos-sdk 0.43 - */ -export interface QueryAccountsResponse { - /** accounts are the existing accounts */ - accounts: Any[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** QueryAccountRequest is the request type for the Query/Account RPC method. */ -export interface QueryAccountRequest { - /** address defines the address to query for. */ - address: string; -} - -/** QueryAccountResponse is the response type for the Query/Account RPC method. */ -export interface QueryAccountResponse { - /** account defines the account of the corresponding address. */ - account: Any | undefined; -} - -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} - -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponse { - /** params defines the parameters of the module. */ - params: Params | undefined; -} - -const baseQueryAccountsRequest: object = {}; - -export const QueryAccountsRequest = { - encode( - message: QueryAccountsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAccountsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAccountsRequest } as QueryAccountsRequest; - 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): QueryAccountsRequest { - const message = { ...baseQueryAccountsRequest } as QueryAccountsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAccountsRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryAccountsRequest { - const message = { ...baseQueryAccountsRequest } as QueryAccountsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAccountsResponse: object = {}; - -export const QueryAccountsResponse = { - encode( - message: QueryAccountsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.accounts) { - Any.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAccountsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAccountsResponse } as QueryAccountsResponse; - message.accounts = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.accounts.push(Any.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 { - const message = { ...baseQueryAccountsResponse } as QueryAccountsResponse; - message.accounts = []; - if (object.accounts !== undefined && object.accounts !== null) { - for (const e of object.accounts) { - message.accounts.push(Any.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAccountsResponse): unknown { - const obj: any = {}; - if (message.accounts) { - obj.accounts = message.accounts.map((e) => - e ? Any.toJSON(e) : undefined - ); - } else { - obj.accounts = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAccountsResponse { - const message = { ...baseQueryAccountsResponse } as QueryAccountsResponse; - message.accounts = []; - if (object.accounts !== undefined && object.accounts !== null) { - for (const e of object.accounts) { - message.accounts.push(Any.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAccountRequest: object = { address: "" }; - -export const QueryAccountRequest = { - encode( - message: QueryAccountRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAccountRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAccountRequest } as QueryAccountRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAccountRequest { - const message = { ...baseQueryAccountRequest } as QueryAccountRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - return message; - }, - - toJSON(message: QueryAccountRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - return obj; - }, - - fromPartial(object: DeepPartial): QueryAccountRequest { - const message = { ...baseQueryAccountRequest } as QueryAccountRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - return message; - }, -}; - -const baseQueryAccountResponse: object = {}; - -export const QueryAccountResponse = { - encode( - message: QueryAccountResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.account !== undefined) { - Any.encode(message.account, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAccountResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAccountResponse } as QueryAccountResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.account = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAccountResponse { - const message = { ...baseQueryAccountResponse } as QueryAccountResponse; - if (object.account !== undefined && object.account !== null) { - message.account = Any.fromJSON(object.account); - } else { - message.account = undefined; - } - return message; - }, - - toJSON(message: QueryAccountResponse): unknown { - const obj: any = {}; - message.account !== undefined && - (obj.account = message.account ? Any.toJSON(message.account) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryAccountResponse { - const message = { ...baseQueryAccountResponse } as QueryAccountResponse; - if (object.account !== undefined && object.account !== null) { - message.account = Any.fromPartial(object.account); - } else { - message.account = undefined; - } - return message; - }, -}; - -const baseQueryParamsRequest: object = {}; - -export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, - - toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, -}; - -const baseQueryParamsResponse: object = {}; - -export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - 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): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * Accounts returns all the existing accounts - * - * Since: cosmos-sdk 0.43 - */ - Accounts(request: QueryAccountsRequest): Promise; - /** Account returns account details based on address. */ - Account(request: QueryAccountRequest): Promise; - /** Params queries all parameters. */ - Params(request: QueryParamsRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Accounts(request: QueryAccountsRequest): Promise { - const data = QueryAccountsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.auth.v1beta1.Query", - "Accounts", - data - ); - return promise.then((data) => - QueryAccountsResponse.decode(new Reader(data)) - ); - } - - Account(request: QueryAccountRequest): Promise { - const data = QueryAccountRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.auth.v1beta1.Query", - "Account", - data - ); - return promise.then((data) => - QueryAccountResponse.decode(new Reader(data)) - ); - } - - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.auth.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos_proto/cosmos.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos_proto/cosmos.ts deleted file mode 100644 index 9ec67a12..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/cosmos_proto/cosmos.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "cosmos_proto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/package.json deleted file mode 100644 index fcd5e39e..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-auth-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.auth.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/auth/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.auth.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/index.ts deleted file mode 100644 index 16c33851..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/index.ts +++ /dev/null @@ -1,403 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { SendAuthorization } from "./module/types/cosmos/bank/v1beta1/authz" -import { Params } from "./module/types/cosmos/bank/v1beta1/bank" -import { SendEnabled } from "./module/types/cosmos/bank/v1beta1/bank" -import { Input } from "./module/types/cosmos/bank/v1beta1/bank" -import { Output } from "./module/types/cosmos/bank/v1beta1/bank" -import { Supply } from "./module/types/cosmos/bank/v1beta1/bank" -import { DenomUnit } from "./module/types/cosmos/bank/v1beta1/bank" -import { Metadata } from "./module/types/cosmos/bank/v1beta1/bank" -import { Balance } from "./module/types/cosmos/bank/v1beta1/genesis" - - -export { SendAuthorization, Params, SendEnabled, Input, Output, Supply, DenomUnit, Metadata, Balance }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Balance: {}, - AllBalances: {}, - TotalSupply: {}, - SupplyOf: {}, - Params: {}, - DenomMetadata: {}, - DenomsMetadata: {}, - - _Structure: { - SendAuthorization: getStructure(SendAuthorization.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - SendEnabled: getStructure(SendEnabled.fromPartial({})), - Input: getStructure(Input.fromPartial({})), - Output: getStructure(Output.fromPartial({})), - Supply: getStructure(Supply.fromPartial({})), - DenomUnit: getStructure(DenomUnit.fromPartial({})), - Metadata: getStructure(Metadata.fromPartial({})), - Balance: getStructure(Balance.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getBalance: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Balance[JSON.stringify(params)] ?? {} - }, - getAllBalances: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AllBalances[JSON.stringify(params)] ?? {} - }, - getTotalSupply: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TotalSupply[JSON.stringify(params)] ?? {} - }, - getSupplyOf: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.SupplyOf[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getDenomMetadata: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomMetadata[JSON.stringify(params)] ?? {} - }, - getDenomsMetadata: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomsMetadata[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.bank.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryBalance({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryBalance( key.address, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryBalance( key.address, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Balance', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryBalance', payload: { options: { all }, params: {...key},query }}) - return getters['getBalance']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryBalance API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAllBalances({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryAllBalances( key.address, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryAllBalances( key.address, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AllBalances', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllBalances', payload: { options: { all }, params: {...key},query }}) - return getters['getAllBalances']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllBalances API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryTotalSupply({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryTotalSupply(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryTotalSupply({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'TotalSupply', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryTotalSupply', payload: { options: { all }, params: {...key},query }}) - return getters['getTotalSupply']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryTotalSupply API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySupplyOf({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.querySupplyOf( key.denom)).data - - - commit('QUERY', { query: 'SupplyOf', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySupplyOf', payload: { options: { all }, params: {...key},query }}) - return getters['getSupplyOf']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySupplyOf API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDenomMetadata({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDenomMetadata( key.denom)).data - - - commit('QUERY', { query: 'DenomMetadata', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomMetadata', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomMetadata']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomMetadata API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDenomsMetadata({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDenomsMetadata(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryDenomsMetadata({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DenomsMetadata', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomsMetadata', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomsMetadata']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomsMetadata API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgMultiSend({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgMultiSend(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgMultiSend:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgMultiSend:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgSend({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSend(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSend:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSend:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgMultiSend({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgMultiSend(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgMultiSend:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgMultiSend:Create Could not create message: ' + e.message) - } - } - }, - async MsgSend({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSend(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSend:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSend:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/index.ts deleted file mode 100644 index 6955b39a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/index.ts +++ /dev/null @@ -1,63 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx"; -import { MsgSend } from "./types/cosmos/bank/v1beta1/tx"; - - -const types = [ - ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], - ["/cosmos.bank.v1beta1.MsgSend", MsgSend], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgMultiSend: (data: MsgMultiSend): EncodeObject => ({ typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.fromPartial( data ) }), - msgSend: (data: MsgSend): EncodeObject => ({ typeUrl: "/cosmos.bank.v1beta1.MsgSend", value: MsgSend.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/rest.ts deleted file mode 100644 index 44c4c18b..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/rest.ts +++ /dev/null @@ -1,596 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface ProtobufAny { - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* 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 V1Beta1Coin { - denom?: string; - amount?: string; -} - -/** -* DenomUnit represents a struct that describes a given -denomination unit of the basic token. -*/ -export interface V1Beta1DenomUnit { - /** denom represents the string name of the given denom unit (e.g uatom). */ - denom?: string; - - /** - * exponent represents power of 10 exponent that one must - * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom - * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - * exponent = 6, thus: 1 atom = 10^6 uatom). - * @format int64 - */ - exponent?: number; - aliases?: string[]; -} - -/** - * Input models transaction input. - */ -export interface V1Beta1Input { - address?: string; - coins?: V1Beta1Coin[]; -} - -/** -* Metadata represents a struct that describes -a basic token. -*/ -export interface V1Beta1Metadata { - description?: string; - denom_units?: V1Beta1DenomUnit[]; - - /** base represents the base denom (should be the DenomUnit with exponent = 0). */ - base?: string; - - /** - * display indicates the suggested denom that should be - * displayed in clients. - */ - display?: string; - - /** Since: cosmos-sdk 0.43 */ - name?: string; - - /** - * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - * be the same as the display. - * - * Since: cosmos-sdk 0.43 - */ - symbol?: string; -} - -/** - * MsgMultiSendResponse defines the Msg/MultiSend response type. - */ -export type V1Beta1MsgMultiSendResponse = object; - -/** - * MsgSendResponse defines the Msg/Send response type. - */ -export type V1Beta1MsgSendResponse = object; - -/** - * Output models transaction outputs. - */ -export interface V1Beta1Output { - address?: string; - coins?: V1Beta1Coin[]; -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * Params defines the parameters for the bank module. - */ -export interface V1Beta1Params { - send_enabled?: V1Beta1SendEnabled[]; - default_send_enabled?: boolean; -} - -/** -* QueryAllBalancesResponse is the response type for the Query/AllBalances RPC -method. -*/ -export interface V1Beta1QueryAllBalancesResponse { - /** balances is the balances of all the coins. */ - balances?: V1Beta1Coin[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * QueryBalanceResponse is the response type for the Query/Balance RPC method. - */ -export interface V1Beta1QueryBalanceResponse { - /** balance is the balance of the coin. */ - balance?: V1Beta1Coin; -} - -/** -* QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC -method. -*/ -export interface V1Beta1QueryDenomMetadataResponse { - /** metadata describes and provides all the client information for the requested token. */ - metadata?: V1Beta1Metadata; -} - -/** -* QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC -method. -*/ -export interface V1Beta1QueryDenomsMetadataResponse { - /** metadata provides the client information for all the registered tokens. */ - metadatas?: V1Beta1Metadata[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * QueryParamsResponse defines the response type for querying x/bank parameters. - */ -export interface V1Beta1QueryParamsResponse { - /** Params defines the parameters for the bank module. */ - params?: V1Beta1Params; -} - -/** - * QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. - */ -export interface V1Beta1QuerySupplyOfResponse { - /** amount is the supply of the coin. */ - amount?: V1Beta1Coin; -} - -export interface V1Beta1QueryTotalSupplyResponse { - supply?: V1Beta1Coin[]; - - /** - * pagination defines the pagination in the response. - * - * Since: cosmos-sdk 0.43 - */ - pagination?: V1Beta1PageResponse; -} - -/** -* SendEnabled maps coin denom to a send_enabled status (whether a denom is -sendable). -*/ -export interface V1Beta1SendEnabled { - denom?: string; - enabled?: boolean; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/bank/v1beta1/authz.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryAllBalances - * @summary AllBalances queries the balance of all coins for a single account. - * @request GET:/cosmos/bank/v1beta1/balances/{address} - */ - queryAllBalances = ( - address: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/bank/v1beta1/balances/${address}`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryBalance - * @summary Balance queries the balance of a single coin for a single account. - * @request GET:/cosmos/bank/v1beta1/balances/{address}/by_denom - */ - queryBalance = (address: string, query?: { denom?: string }, params: RequestParams = {}) => - this.request({ - path: `/cosmos/bank/v1beta1/balances/${address}/by_denom`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDenomsMetadata - * @summary DenomsMetadata queries the client metadata for all registered coin denominations. - * @request GET:/cosmos/bank/v1beta1/denoms_metadata - */ - queryDenomsMetadata = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/bank/v1beta1/denoms_metadata`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDenomMetadata - * @summary DenomsMetadata queries the client metadata of a given coin denomination. - * @request GET:/cosmos/bank/v1beta1/denoms_metadata/{denom} - */ - queryDenomMetadata = (denom: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/bank/v1beta1/denoms_metadata/${denom}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryParams - * @summary Params queries the parameters of x/bank module. - * @request GET:/cosmos/bank/v1beta1/params - */ - queryParams = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/bank/v1beta1/params`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryTotalSupply - * @summary TotalSupply queries the total supply of all coins. - * @request GET:/cosmos/bank/v1beta1/supply - */ - queryTotalSupply = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/bank/v1beta1/supply`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QuerySupplyOf - * @summary SupplyOf queries the supply of a single coin. - * @request GET:/cosmos/bank/v1beta1/supply/{denom} - */ - querySupplyOf = (denom: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/bank/v1beta1/supply/${denom}`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/authz.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/authz.ts deleted file mode 100644 index e174b5ac..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/authz.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.bank.v1beta1"; - -/** - * SendAuthorization allows the grantee to spend up to spend_limit coins from - * the granter's account. - * - * Since: cosmos-sdk 0.43 - */ -export interface SendAuthorization { - spend_limit: Coin[]; -} - -const baseSendAuthorization: object = {}; - -export const SendAuthorization = { - encode(message: SendAuthorization, writer: Writer = Writer.create()): Writer { - for (const v of message.spend_limit) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SendAuthorization { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSendAuthorization } as SendAuthorization; - message.spend_limit = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.spend_limit.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SendAuthorization { - const message = { ...baseSendAuthorization } as SendAuthorization; - message.spend_limit = []; - if (object.spend_limit !== undefined && object.spend_limit !== null) { - for (const e of object.spend_limit) { - message.spend_limit.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: SendAuthorization): unknown { - const obj: any = {}; - if (message.spend_limit) { - obj.spend_limit = message.spend_limit.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.spend_limit = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): SendAuthorization { - const message = { ...baseSendAuthorization } as SendAuthorization; - message.spend_limit = []; - if (object.spend_limit !== undefined && object.spend_limit !== null) { - for (const e of object.spend_limit) { - message.spend_limit.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/bank.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/bank.ts deleted file mode 100644 index 87339324..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/bank.ts +++ /dev/null @@ -1,737 +0,0 @@ -/* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.bank.v1beta1"; - -/** Params defines the parameters for the bank module. */ -export interface Params { - send_enabled: SendEnabled[]; - default_send_enabled: boolean; -} - -/** - * SendEnabled maps coin denom to a send_enabled status (whether a denom is - * sendable). - */ -export interface SendEnabled { - denom: string; - enabled: boolean; -} - -/** Input models transaction input. */ -export interface Input { - address: string; - coins: Coin[]; -} - -/** Output models transaction outputs. */ -export interface Output { - address: string; - coins: Coin[]; -} - -/** - * Supply represents a struct that passively keeps track of the total supply - * amounts in the network. - * This message is deprecated now that supply is indexed by denom. - * - * @deprecated - */ -export interface Supply { - total: Coin[]; -} - -/** - * DenomUnit represents a struct that describes a given - * denomination unit of the basic token. - */ -export interface DenomUnit { - /** denom represents the string name of the given denom unit (e.g uatom). */ - denom: string; - /** - * exponent represents power of 10 exponent that one must - * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom - * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - * exponent = 6, thus: 1 atom = 10^6 uatom). - */ - exponent: number; - /** aliases is a list of string aliases for the given denom */ - aliases: string[]; -} - -/** - * Metadata represents a struct that describes - * a basic token. - */ -export interface Metadata { - description: string; - /** denom_units represents the list of DenomUnit's for a given coin */ - denom_units: DenomUnit[]; - /** base represents the base denom (should be the DenomUnit with exponent = 0). */ - base: string; - /** - * display indicates the suggested denom that should be - * displayed in clients. - */ - display: string; - /** - * name defines the name of the token (eg: Cosmos Atom) - * - * Since: cosmos-sdk 0.43 - */ - name: string; - /** - * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - * be the same as the display. - * - * Since: cosmos-sdk 0.43 - */ - symbol: string; -} - -const baseParams: object = { default_send_enabled: false }; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - for (const v of message.send_enabled) { - SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.default_send_enabled === true) { - writer.uint32(16).bool(message.default_send_enabled); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - message.send_enabled = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.send_enabled.push( - SendEnabled.decode(reader, reader.uint32()) - ); - break; - case 2: - message.default_send_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - message.send_enabled = []; - if (object.send_enabled !== undefined && object.send_enabled !== null) { - for (const e of object.send_enabled) { - message.send_enabled.push(SendEnabled.fromJSON(e)); - } - } - if ( - object.default_send_enabled !== undefined && - object.default_send_enabled !== null - ) { - message.default_send_enabled = Boolean(object.default_send_enabled); - } else { - message.default_send_enabled = false; - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - if (message.send_enabled) { - obj.send_enabled = message.send_enabled.map((e) => - e ? SendEnabled.toJSON(e) : undefined - ); - } else { - obj.send_enabled = []; - } - message.default_send_enabled !== undefined && - (obj.default_send_enabled = message.default_send_enabled); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - message.send_enabled = []; - if (object.send_enabled !== undefined && object.send_enabled !== null) { - for (const e of object.send_enabled) { - message.send_enabled.push(SendEnabled.fromPartial(e)); - } - } - if ( - object.default_send_enabled !== undefined && - object.default_send_enabled !== null - ) { - message.default_send_enabled = object.default_send_enabled; - } else { - message.default_send_enabled = false; - } - return message; - }, -}; - -const baseSendEnabled: object = { denom: "", enabled: false }; - -export const SendEnabled = { - encode(message: SendEnabled, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.enabled === true) { - writer.uint32(16).bool(message.enabled); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SendEnabled { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSendEnabled } as SendEnabled; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SendEnabled { - const message = { ...baseSendEnabled } as SendEnabled; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.enabled !== undefined && object.enabled !== null) { - message.enabled = Boolean(object.enabled); - } else { - message.enabled = false; - } - return message; - }, - - toJSON(message: SendEnabled): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.enabled !== undefined && (obj.enabled = message.enabled); - return obj; - }, - - fromPartial(object: DeepPartial): SendEnabled { - const message = { ...baseSendEnabled } as SendEnabled; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.enabled !== undefined && object.enabled !== null) { - message.enabled = object.enabled; - } else { - message.enabled = false; - } - return message; - }, -}; - -const baseInput: object = { address: "" }; - -export const Input = { - encode(message: Input, writer: Writer = Writer.create()): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - for (const v of message.coins) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Input { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseInput } as Input; - message.coins = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.coins.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Input { - const message = { ...baseInput } as Input; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Input): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - if (message.coins) { - obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.coins = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Input { - const message = { ...baseInput } as Input; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOutput: object = { address: "" }; - -export const Output = { - encode(message: Output, writer: Writer = Writer.create()): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - for (const v of message.coins) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Output { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOutput } as Output; - message.coins = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.coins.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Output { - const message = { ...baseOutput } as Output; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Output): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - if (message.coins) { - obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.coins = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Output { - const message = { ...baseOutput } as Output; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSupply: object = {}; - -export const Supply = { - encode(message: Supply, writer: Writer = Writer.create()): Writer { - for (const v of message.total) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Supply { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSupply } as Supply; - message.total = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Supply { - const message = { ...baseSupply } as Supply; - message.total = []; - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Supply): unknown { - const obj: any = {}; - if (message.total) { - obj.total = message.total.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.total = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Supply { - const message = { ...baseSupply } as Supply; - message.total = []; - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseDenomUnit: object = { denom: "", exponent: 0, aliases: "" }; - -export const DenomUnit = { - encode(message: DenomUnit, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.exponent !== 0) { - writer.uint32(16).uint32(message.exponent); - } - for (const v of message.aliases) { - writer.uint32(26).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DenomUnit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDenomUnit } as DenomUnit; - message.aliases = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.exponent = reader.uint32(); - break; - case 3: - message.aliases.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DenomUnit { - const message = { ...baseDenomUnit } as DenomUnit; - message.aliases = []; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.exponent !== undefined && object.exponent !== null) { - message.exponent = Number(object.exponent); - } else { - message.exponent = 0; - } - if (object.aliases !== undefined && object.aliases !== null) { - for (const e of object.aliases) { - message.aliases.push(String(e)); - } - } - return message; - }, - - toJSON(message: DenomUnit): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.exponent !== undefined && (obj.exponent = message.exponent); - if (message.aliases) { - obj.aliases = message.aliases.map((e) => e); - } else { - obj.aliases = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DenomUnit { - const message = { ...baseDenomUnit } as DenomUnit; - message.aliases = []; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.exponent !== undefined && object.exponent !== null) { - message.exponent = object.exponent; - } else { - message.exponent = 0; - } - if (object.aliases !== undefined && object.aliases !== null) { - for (const e of object.aliases) { - message.aliases.push(e); - } - } - return message; - }, -}; - -const baseMetadata: object = { - description: "", - base: "", - display: "", - name: "", - symbol: "", -}; - -export const Metadata = { - encode(message: Metadata, writer: Writer = Writer.create()): Writer { - if (message.description !== "") { - writer.uint32(10).string(message.description); - } - for (const v of message.denom_units) { - DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.base !== "") { - writer.uint32(26).string(message.base); - } - if (message.display !== "") { - writer.uint32(34).string(message.display); - } - if (message.name !== "") { - writer.uint32(42).string(message.name); - } - if (message.symbol !== "") { - writer.uint32(50).string(message.symbol); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMetadata } as Metadata; - message.denom_units = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.description = reader.string(); - break; - case 2: - message.denom_units.push(DenomUnit.decode(reader, reader.uint32())); - break; - case 3: - message.base = reader.string(); - break; - case 4: - message.display = reader.string(); - break; - case 5: - message.name = reader.string(); - break; - case 6: - message.symbol = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Metadata { - const message = { ...baseMetadata } as Metadata; - message.denom_units = []; - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.denom_units !== undefined && object.denom_units !== null) { - for (const e of object.denom_units) { - message.denom_units.push(DenomUnit.fromJSON(e)); - } - } - if (object.base !== undefined && object.base !== null) { - message.base = String(object.base); - } else { - message.base = ""; - } - if (object.display !== undefined && object.display !== null) { - message.display = String(object.display); - } else { - message.display = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.symbol !== undefined && object.symbol !== null) { - message.symbol = String(object.symbol); - } else { - message.symbol = ""; - } - return message; - }, - - toJSON(message: Metadata): unknown { - const obj: any = {}; - message.description !== undefined && - (obj.description = message.description); - if (message.denom_units) { - obj.denom_units = message.denom_units.map((e) => - e ? DenomUnit.toJSON(e) : undefined - ); - } else { - obj.denom_units = []; - } - message.base !== undefined && (obj.base = message.base); - message.display !== undefined && (obj.display = message.display); - message.name !== undefined && (obj.name = message.name); - message.symbol !== undefined && (obj.symbol = message.symbol); - return obj; - }, - - fromPartial(object: DeepPartial): Metadata { - const message = { ...baseMetadata } as Metadata; - message.denom_units = []; - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.denom_units !== undefined && object.denom_units !== null) { - for (const e of object.denom_units) { - message.denom_units.push(DenomUnit.fromPartial(e)); - } - } - if (object.base !== undefined && object.base !== null) { - message.base = object.base; - } else { - message.base = ""; - } - if (object.display !== undefined && object.display !== null) { - message.display = object.display; - } else { - message.display = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.symbol !== undefined && object.symbol !== null) { - message.symbol = object.symbol; - } else { - message.symbol = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/genesis.ts deleted file mode 100644 index ec379349..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/genesis.ts +++ /dev/null @@ -1,254 +0,0 @@ -/* eslint-disable */ -import { Params, Metadata } from "../../../cosmos/bank/v1beta1/bank"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.bank.v1beta1"; - -/** GenesisState defines the bank module's genesis state. */ -export interface GenesisState { - /** params defines all the paramaters of the module. */ - params: Params | undefined; - /** balances is an array containing the balances of all the accounts. */ - balances: Balance[]; - /** - * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided - * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - */ - supply: Coin[]; - /** denom_metadata defines the metadata of the differents coins. */ - denom_metadata: Metadata[]; -} - -/** - * Balance defines an account address and balance pair used in the bank module's - * genesis state. - */ -export interface Balance { - /** address is the address of the balance holder. */ - address: string; - /** coins defines the different coins this balance holds. */ - coins: Coin[]; -} - -const baseGenesisState: object = {}; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.balances) { - Balance.encode(v!, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.supply) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.denom_metadata) { - Metadata.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.balances = []; - message.supply = []; - message.denom_metadata = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - case 2: - message.balances.push(Balance.decode(reader, reader.uint32())); - break; - case 3: - message.supply.push(Coin.decode(reader, reader.uint32())); - break; - case 4: - message.denom_metadata.push(Metadata.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.balances = []; - message.supply = []; - message.denom_metadata = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Balance.fromJSON(e)); - } - } - if (object.supply !== undefined && object.supply !== null) { - for (const e of object.supply) { - message.supply.push(Coin.fromJSON(e)); - } - } - if (object.denom_metadata !== undefined && object.denom_metadata !== null) { - for (const e of object.denom_metadata) { - message.denom_metadata.push(Metadata.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - if (message.balances) { - obj.balances = message.balances.map((e) => - e ? Balance.toJSON(e) : undefined - ); - } else { - obj.balances = []; - } - if (message.supply) { - obj.supply = message.supply.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.supply = []; - } - if (message.denom_metadata) { - obj.denom_metadata = message.denom_metadata.map((e) => - e ? Metadata.toJSON(e) : undefined - ); - } else { - obj.denom_metadata = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.balances = []; - message.supply = []; - message.denom_metadata = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Balance.fromPartial(e)); - } - } - if (object.supply !== undefined && object.supply !== null) { - for (const e of object.supply) { - message.supply.push(Coin.fromPartial(e)); - } - } - if (object.denom_metadata !== undefined && object.denom_metadata !== null) { - for (const e of object.denom_metadata) { - message.denom_metadata.push(Metadata.fromPartial(e)); - } - } - return message; - }, -}; - -const baseBalance: object = { address: "" }; - -export const Balance = { - encode(message: Balance, writer: Writer = Writer.create()): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - for (const v of message.coins) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Balance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBalance } as Balance; - message.coins = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.coins.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Balance { - const message = { ...baseBalance } as Balance; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Balance): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - if (message.coins) { - obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.coins = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Balance { - const message = { ...baseBalance } as Balance; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/query.ts deleted file mode 100644 index a1611e05..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/query.ts +++ /dev/null @@ -1,1285 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; -import { Params, Metadata } from "../../../cosmos/bank/v1beta1/bank"; - -export const protobufPackage = "cosmos.bank.v1beta1"; - -/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ -export interface QueryBalanceRequest { - /** address is the address to query balances for. */ - address: string; - /** denom is the coin denom to query balances for. */ - denom: string; -} - -/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ -export interface QueryBalanceResponse { - /** balance is the balance of the coin. */ - balance: Coin | undefined; -} - -/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ -export interface QueryAllBalancesRequest { - /** address is the address to query balances for. */ - address: string; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC - * method. - */ -export interface QueryAllBalancesResponse { - /** balances is the balances of all the coins. */ - balances: Coin[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** - * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC - * method. - */ -export interface QueryTotalSupplyRequest { - /** - * pagination defines an optional pagination for the request. - * - * Since: cosmos-sdk 0.43 - */ - pagination: PageRequest | undefined; -} - -/** - * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC - * method - */ -export interface QueryTotalSupplyResponse { - /** supply is the supply of the coins */ - supply: Coin[]; - /** - * pagination defines the pagination in the response. - * - * Since: cosmos-sdk 0.43 - */ - pagination: PageResponse | undefined; -} - -/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ -export interface QuerySupplyOfRequest { - /** denom is the coin denom to query balances for. */ - denom: string; -} - -/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ -export interface QuerySupplyOfResponse { - /** amount is the supply of the coin. */ - amount: Coin | undefined; -} - -/** QueryParamsRequest defines the request type for querying x/bank parameters. */ -export interface QueryParamsRequest {} - -/** QueryParamsResponse defines the response type for querying x/bank parameters. */ -export interface QueryParamsResponse { - params: Params | undefined; -} - -/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ -export interface QueryDenomsMetadataRequest { - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC - * method. - */ -export interface QueryDenomsMetadataResponse { - /** metadata provides the client information for all the registered tokens. */ - metadatas: Metadata[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ -export interface QueryDenomMetadataRequest { - /** denom is the coin denom to query the metadata for. */ - denom: string; -} - -/** - * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC - * method. - */ -export interface QueryDenomMetadataResponse { - /** metadata describes and provides all the client information for the requested token. */ - metadata: Metadata | undefined; -} - -const baseQueryBalanceRequest: object = { address: "", denom: "" }; - -export const QueryBalanceRequest = { - encode( - message: QueryBalanceRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.denom !== "") { - writer.uint32(18).string(message.denom); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryBalanceRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.denom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryBalanceRequest { - const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - return message; - }, - - toJSON(message: QueryBalanceRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.denom !== undefined && (obj.denom = message.denom); - return obj; - }, - - fromPartial(object: DeepPartial): QueryBalanceRequest { - const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - return message; - }, -}; - -const baseQueryBalanceResponse: object = {}; - -export const QueryBalanceResponse = { - encode( - message: QueryBalanceResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.balance !== undefined) { - Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryBalanceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balance = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryBalanceResponse { - const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromJSON(object.balance); - } else { - message.balance = undefined; - } - return message; - }, - - toJSON(message: QueryBalanceResponse): unknown { - const obj: any = {}; - message.balance !== undefined && - (obj.balance = message.balance - ? Coin.toJSON(message.balance) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryBalanceResponse { - const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromPartial(object.balance); - } else { - message.balance = undefined; - } - return message; - }, -}; - -const baseQueryAllBalancesRequest: object = { address: "" }; - -export const QueryAllBalancesRequest = { - encode( - message: QueryAllBalancesRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAllBalancesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllBalancesRequest, - } as QueryAllBalancesRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllBalancesRequest { - const message = { - ...baseQueryAllBalancesRequest, - } as QueryAllBalancesRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllBalancesRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllBalancesRequest { - const message = { - ...baseQueryAllBalancesRequest, - } as QueryAllBalancesRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllBalancesResponse: object = {}; - -export const QueryAllBalancesResponse = { - encode( - message: QueryAllBalancesResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.balances) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllBalancesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllBalancesResponse, - } as QueryAllBalancesResponse; - message.balances = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balances.push(Coin.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): QueryAllBalancesResponse { - const message = { - ...baseQueryAllBalancesResponse, - } as QueryAllBalancesResponse; - message.balances = []; - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Coin.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllBalancesResponse): unknown { - const obj: any = {}; - if (message.balances) { - obj.balances = message.balances.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.balances = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllBalancesResponse { - const message = { - ...baseQueryAllBalancesResponse, - } as QueryAllBalancesResponse; - message.balances = []; - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Coin.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryTotalSupplyRequest: object = {}; - -export const QueryTotalSupplyRequest = { - encode( - message: QueryTotalSupplyRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryTotalSupplyRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryTotalSupplyRequest, - } as QueryTotalSupplyRequest; - 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): QueryTotalSupplyRequest { - const message = { - ...baseQueryTotalSupplyRequest, - } as QueryTotalSupplyRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryTotalSupplyRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryTotalSupplyRequest { - const message = { - ...baseQueryTotalSupplyRequest, - } as QueryTotalSupplyRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryTotalSupplyResponse: object = {}; - -export const QueryTotalSupplyResponse = { - encode( - message: QueryTotalSupplyResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.supply) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryTotalSupplyResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryTotalSupplyResponse, - } as QueryTotalSupplyResponse; - message.supply = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.supply.push(Coin.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): QueryTotalSupplyResponse { - const message = { - ...baseQueryTotalSupplyResponse, - } as QueryTotalSupplyResponse; - message.supply = []; - if (object.supply !== undefined && object.supply !== null) { - for (const e of object.supply) { - message.supply.push(Coin.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryTotalSupplyResponse): unknown { - const obj: any = {}; - if (message.supply) { - obj.supply = message.supply.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.supply = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryTotalSupplyResponse { - const message = { - ...baseQueryTotalSupplyResponse, - } as QueryTotalSupplyResponse; - message.supply = []; - if (object.supply !== undefined && object.supply !== null) { - for (const e of object.supply) { - message.supply.push(Coin.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQuerySupplyOfRequest: object = { denom: "" }; - -export const QuerySupplyOfRequest = { - encode( - message: QuerySupplyOfRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QuerySupplyOfRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QuerySupplyOfRequest { - const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - return message; - }, - - toJSON(message: QuerySupplyOfRequest): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - return obj; - }, - - fromPartial(object: DeepPartial): QuerySupplyOfRequest { - const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - return message; - }, -}; - -const baseQuerySupplyOfResponse: object = {}; - -export const QuerySupplyOfResponse = { - encode( - message: QuerySupplyOfResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.amount !== undefined) { - Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QuerySupplyOfResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QuerySupplyOfResponse { - const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - return message; - }, - - toJSON(message: QuerySupplyOfResponse): unknown { - const obj: any = {}; - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QuerySupplyOfResponse { - const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; - } - return message; - }, -}; - -const baseQueryParamsRequest: object = {}; - -export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, - - toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, -}; - -const baseQueryParamsResponse: object = {}; - -export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - 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): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -const baseQueryDenomsMetadataRequest: object = {}; - -export const QueryDenomsMetadataRequest = { - encode( - message: QueryDenomsMetadataRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomsMetadataRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomsMetadataRequest, - } as QueryDenomsMetadataRequest; - 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): QueryDenomsMetadataRequest { - const message = { - ...baseQueryDenomsMetadataRequest, - } as QueryDenomsMetadataRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDenomsMetadataRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDenomsMetadataRequest { - const message = { - ...baseQueryDenomsMetadataRequest, - } as QueryDenomsMetadataRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDenomsMetadataResponse: object = {}; - -export const QueryDenomsMetadataResponse = { - encode( - message: QueryDenomsMetadataResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.metadatas) { - Metadata.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomsMetadataResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomsMetadataResponse, - } as QueryDenomsMetadataResponse; - message.metadatas = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.metadatas.push(Metadata.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): QueryDenomsMetadataResponse { - const message = { - ...baseQueryDenomsMetadataResponse, - } as QueryDenomsMetadataResponse; - message.metadatas = []; - if (object.metadatas !== undefined && object.metadatas !== null) { - for (const e of object.metadatas) { - message.metadatas.push(Metadata.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDenomsMetadataResponse): unknown { - const obj: any = {}; - if (message.metadatas) { - obj.metadatas = message.metadatas.map((e) => - e ? Metadata.toJSON(e) : undefined - ); - } else { - obj.metadatas = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDenomsMetadataResponse { - const message = { - ...baseQueryDenomsMetadataResponse, - } as QueryDenomsMetadataResponse; - message.metadatas = []; - if (object.metadatas !== undefined && object.metadatas !== null) { - for (const e of object.metadatas) { - message.metadatas.push(Metadata.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDenomMetadataRequest: object = { denom: "" }; - -export const QueryDenomMetadataRequest = { - encode( - message: QueryDenomMetadataRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomMetadataRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomMetadataRequest, - } as QueryDenomMetadataRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDenomMetadataRequest { - const message = { - ...baseQueryDenomMetadataRequest, - } as QueryDenomMetadataRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - return message; - }, - - toJSON(message: QueryDenomMetadataRequest): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDenomMetadataRequest { - const message = { - ...baseQueryDenomMetadataRequest, - } as QueryDenomMetadataRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - return message; - }, -}; - -const baseQueryDenomMetadataResponse: object = {}; - -export const QueryDenomMetadataResponse = { - encode( - message: QueryDenomMetadataResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.metadata !== undefined) { - Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomMetadataResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomMetadataResponse, - } as QueryDenomMetadataResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.metadata = Metadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDenomMetadataResponse { - const message = { - ...baseQueryDenomMetadataResponse, - } as QueryDenomMetadataResponse; - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = Metadata.fromJSON(object.metadata); - } else { - message.metadata = undefined; - } - return message; - }, - - toJSON(message: QueryDenomMetadataResponse): unknown { - const obj: any = {}; - message.metadata !== undefined && - (obj.metadata = message.metadata - ? Metadata.toJSON(message.metadata) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDenomMetadataResponse { - const message = { - ...baseQueryDenomMetadataResponse, - } as QueryDenomMetadataResponse; - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = Metadata.fromPartial(object.metadata); - } else { - message.metadata = undefined; - } - return message; - }, -}; - -/** Query defines the gRPC querier service. */ -export interface Query { - /** Balance queries the balance of a single coin for a single account. */ - Balance(request: QueryBalanceRequest): Promise; - /** AllBalances queries the balance of all coins for a single account. */ - AllBalances( - request: QueryAllBalancesRequest - ): Promise; - /** TotalSupply queries the total supply of all coins. */ - TotalSupply( - request: QueryTotalSupplyRequest - ): Promise; - /** SupplyOf queries the supply of a single coin. */ - SupplyOf(request: QuerySupplyOfRequest): Promise; - /** Params queries the parameters of x/bank module. */ - Params(request: QueryParamsRequest): Promise; - /** DenomsMetadata queries the client metadata of a given coin denomination. */ - DenomMetadata( - request: QueryDenomMetadataRequest - ): Promise; - /** DenomsMetadata queries the client metadata for all registered coin denominations. */ - DenomsMetadata( - request: QueryDenomsMetadataRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Balance(request: QueryBalanceRequest): Promise { - const data = QueryBalanceRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "Balance", - data - ); - return promise.then((data) => - QueryBalanceResponse.decode(new Reader(data)) - ); - } - - AllBalances( - request: QueryAllBalancesRequest - ): Promise { - const data = QueryAllBalancesRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "AllBalances", - data - ); - return promise.then((data) => - QueryAllBalancesResponse.decode(new Reader(data)) - ); - } - - TotalSupply( - request: QueryTotalSupplyRequest - ): Promise { - const data = QueryTotalSupplyRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "TotalSupply", - data - ); - return promise.then((data) => - QueryTotalSupplyResponse.decode(new Reader(data)) - ); - } - - SupplyOf(request: QuerySupplyOfRequest): Promise { - const data = QuerySupplyOfRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "SupplyOf", - data - ); - return promise.then((data) => - QuerySupplyOfResponse.decode(new Reader(data)) - ); - } - - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } - - DenomMetadata( - request: QueryDenomMetadataRequest - ): Promise { - const data = QueryDenomMetadataRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "DenomMetadata", - data - ); - return promise.then((data) => - QueryDenomMetadataResponse.decode(new Reader(data)) - ); - } - - DenomsMetadata( - request: QueryDenomsMetadataRequest - ): Promise { - const data = QueryDenomsMetadataRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "DenomsMetadata", - data - ); - return promise.then((data) => - QueryDenomsMetadataResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/tx.ts deleted file mode 100644 index 4fd4cd66..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/bank/v1beta1/tx.ts +++ /dev/null @@ -1,337 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Input, Output } from "../../../cosmos/bank/v1beta1/bank"; - -export const protobufPackage = "cosmos.bank.v1beta1"; - -/** MsgSend represents a message to send coins from one account to another. */ -export interface MsgSend { - from_address: string; - to_address: string; - amount: Coin[]; -} - -/** MsgSendResponse defines the Msg/Send response type. */ -export interface MsgSendResponse {} - -/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ -export interface MsgMultiSend { - inputs: Input[]; - outputs: Output[]; -} - -/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ -export interface MsgMultiSendResponse {} - -const baseMsgSend: object = { from_address: "", to_address: "" }; - -export const MsgSend = { - encode(message: MsgSend, writer: Writer = Writer.create()): Writer { - if (message.from_address !== "") { - writer.uint32(10).string(message.from_address); - } - if (message.to_address !== "") { - writer.uint32(18).string(message.to_address); - } - for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgSend { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSend } as MsgSend; - message.amount = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.from_address = reader.string(); - break; - case 2: - message.to_address = reader.string(); - break; - case 3: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSend { - const message = { ...baseMsgSend } as MsgSend; - message.amount = []; - if (object.from_address !== undefined && object.from_address !== null) { - message.from_address = String(object.from_address); - } else { - message.from_address = ""; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.to_address = String(object.to_address); - } else { - message.to_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MsgSend): unknown { - const obj: any = {}; - message.from_address !== undefined && - (obj.from_address = message.from_address); - message.to_address !== undefined && (obj.to_address = message.to_address); - if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.amount = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MsgSend { - const message = { ...baseMsgSend } as MsgSend; - message.amount = []; - if (object.from_address !== undefined && object.from_address !== null) { - message.from_address = object.from_address; - } else { - message.from_address = ""; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.to_address = object.to_address; - } else { - message.to_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMsgSendResponse: object = {}; - -export const MsgSendResponse = { - encode(_: MsgSendResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgSendResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSendResponse } as MsgSendResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgSendResponse { - const message = { ...baseMsgSendResponse } as MsgSendResponse; - return message; - }, - - toJSON(_: MsgSendResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgSendResponse { - const message = { ...baseMsgSendResponse } as MsgSendResponse; - return message; - }, -}; - -const baseMsgMultiSend: object = {}; - -export const MsgMultiSend = { - encode(message: MsgMultiSend, writer: Writer = Writer.create()): Writer { - for (const v of message.inputs) { - Input.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.outputs) { - Output.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgMultiSend { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMultiSend } as MsgMultiSend; - message.inputs = []; - message.outputs = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.inputs.push(Input.decode(reader, reader.uint32())); - break; - case 2: - message.outputs.push(Output.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgMultiSend { - const message = { ...baseMsgMultiSend } as MsgMultiSend; - message.inputs = []; - message.outputs = []; - if (object.inputs !== undefined && object.inputs !== null) { - for (const e of object.inputs) { - message.inputs.push(Input.fromJSON(e)); - } - } - if (object.outputs !== undefined && object.outputs !== null) { - for (const e of object.outputs) { - message.outputs.push(Output.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MsgMultiSend): unknown { - const obj: any = {}; - if (message.inputs) { - obj.inputs = message.inputs.map((e) => (e ? Input.toJSON(e) : undefined)); - } else { - obj.inputs = []; - } - if (message.outputs) { - obj.outputs = message.outputs.map((e) => - e ? Output.toJSON(e) : undefined - ); - } else { - obj.outputs = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MsgMultiSend { - const message = { ...baseMsgMultiSend } as MsgMultiSend; - message.inputs = []; - message.outputs = []; - if (object.inputs !== undefined && object.inputs !== null) { - for (const e of object.inputs) { - message.inputs.push(Input.fromPartial(e)); - } - } - if (object.outputs !== undefined && object.outputs !== null) { - for (const e of object.outputs) { - message.outputs.push(Output.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMsgMultiSendResponse: object = {}; - -export const MsgMultiSendResponse = { - encode(_: MsgMultiSendResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgMultiSendResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgMultiSendResponse { - const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; - return message; - }, - - toJSON(_: MsgMultiSendResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgMultiSendResponse { - const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; - return message; - }, -}; - -/** Msg defines the bank Msg service. */ -export interface Msg { - /** Send defines a method for sending coins from one account to another account. */ - Send(request: MsgSend): Promise; - /** MultiSend defines a method for sending coins from some accounts to other accounts. */ - MultiSend(request: MsgMultiSend): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Send(request: MsgSend): Promise { - const data = MsgSend.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data); - return promise.then((data) => MsgSendResponse.decode(new Reader(data))); - } - - MultiSend(request: MsgMultiSend): Promise { - const data = MsgMultiSend.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Msg", - "MultiSend", - data - ); - return promise.then((data) => - MsgMultiSendResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ce2ac984..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - 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 { - denom: string; - amount: string; -} - -/** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProto { - int: string; -} - -/** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProto { - dec: string; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - 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 { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - 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): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { - if (message.int !== "") { - writer.uint32(10).string(message.int); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - 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 { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { - if (message.dec !== "") { - writer.uint32(10).string(message.dec); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - 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 { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos_proto/cosmos.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos_proto/cosmos.ts deleted file mode 100644 index 9ec67a12..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/cosmos_proto/cosmos.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "cosmos_proto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/package.json deleted file mode 100644 index f5399885..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-bank-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.bank.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/bank/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.bank.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/index.ts deleted file mode 100644 index 96097f42..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/index.ts +++ /dev/null @@ -1,298 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { Validator } from "./module/types/cosmos/base/tendermint/v1beta1/query" -import { VersionInfo } from "./module/types/cosmos/base/tendermint/v1beta1/query" -import { Module } from "./module/types/cosmos/base/tendermint/v1beta1/query" - - -export { Validator, VersionInfo, Module }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - GetNodeInfo: {}, - GetSyncing: {}, - GetLatestBlock: {}, - GetBlockByHeight: {}, - GetLatestValidatorSet: {}, - GetValidatorSetByHeight: {}, - - _Structure: { - Validator: getStructure(Validator.fromPartial({})), - VersionInfo: getStructure(VersionInfo.fromPartial({})), - Module: getStructure(Module.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getGetNodeInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetNodeInfo[JSON.stringify(params)] ?? {} - }, - getGetSyncing: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetSyncing[JSON.stringify(params)] ?? {} - }, - getGetLatestBlock: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetLatestBlock[JSON.stringify(params)] ?? {} - }, - getGetBlockByHeight: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetBlockByHeight[JSON.stringify(params)] ?? {} - }, - getGetLatestValidatorSet: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetLatestValidatorSet[JSON.stringify(params)] ?? {} - }, - getGetValidatorSetByHeight: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetValidatorSetByHeight[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.base.tendermint.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async ServiceGetNodeInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceGetNodeInfo()).data - - - commit('QUERY', { query: 'GetNodeInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetNodeInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getGetNodeInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetNodeInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetSyncing({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceGetSyncing()).data - - - commit('QUERY', { query: 'GetSyncing', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetSyncing', payload: { options: { all }, params: {...key},query }}) - return getters['getGetSyncing']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetSyncing API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetLatestBlock({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceGetLatestBlock()).data - - - commit('QUERY', { query: 'GetLatestBlock', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetLatestBlock', payload: { options: { all }, params: {...key},query }}) - return getters['getGetLatestBlock']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetLatestBlock API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetBlockByHeight({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceGetBlockByHeight( key.height)).data - - - commit('QUERY', { query: 'GetBlockByHeight', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetBlockByHeight', payload: { options: { all }, params: {...key},query }}) - return getters['getGetBlockByHeight']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetBlockByHeight API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetLatestValidatorSet({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceGetLatestValidatorSet(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.serviceGetLatestValidatorSet({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GetLatestValidatorSet', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetLatestValidatorSet', payload: { options: { all }, params: {...key},query }}) - return getters['getGetLatestValidatorSet']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetLatestValidatorSet API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetValidatorSetByHeight({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceGetValidatorSetByHeight( key.height, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.serviceGetValidatorSetByHeight( key.height, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GetValidatorSetByHeight', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetValidatorSetByHeight', payload: { options: { all }, params: {...key},query }}) - return getters['getGetValidatorSetByHeight']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetValidatorSetByHeight API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/rest.ts deleted file mode 100644 index 30076226..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/rest.ts +++ /dev/null @@ -1,987 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface CryptoPublicKey { - /** @format byte */ - ed25519?: string; - - /** @format byte */ - secp256k1?: string; -} - -export interface P2PDefaultNodeInfo { - protocol_version?: P2PProtocolVersion; - default_node_id?: string; - listen_addr?: string; - network?: string; - version?: string; - - /** @format byte */ - channels?: string; - moniker?: string; - other?: P2PDefaultNodeInfoOther; -} - -export interface P2PDefaultNodeInfoOther { - tx_index?: string; - rpc_address?: string; -} - -export interface P2PProtocolVersion { - /** @format uint64 */ - p2p?: string; - - /** @format uint64 */ - block?: string; - - /** @format uint64 */ - app?: string; -} - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -export interface TenderminttypesValidator { - /** @format byte */ - address?: string; - pub_key?: CryptoPublicKey; - - /** @format int64 */ - voting_power?: string; - - /** @format int64 */ - proposer_priority?: string; -} - -/** - * Validator is the type for the validator-set. - */ -export interface Tendermintv1Beta1Validator { - address?: string; - - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - pub_key?: ProtobufAny; - - /** @format int64 */ - voting_power?: string; - - /** @format int64 */ - proposer_priority?: string; -} - -export interface TypesBlock { - /** Header defines the structure of a Tendermint block header. */ - header?: TypesHeader; - data?: TypesData; - evidence?: TypesEvidenceList; - - /** Commit contains the evidence that a block was committed by a set of validators. */ - last_commit?: TypesCommit; -} - -export interface TypesBlockID { - /** @format byte */ - hash?: string; - part_set_header?: TypesPartSetHeader; -} - -export enum TypesBlockIDFlag { - BLOCK_ID_FLAG_UNKNOWN = "BLOCK_ID_FLAG_UNKNOWN", - BLOCK_ID_FLAG_ABSENT = "BLOCK_ID_FLAG_ABSENT", - BLOCK_ID_FLAG_COMMIT = "BLOCK_ID_FLAG_COMMIT", - BLOCK_ID_FLAG_NIL = "BLOCK_ID_FLAG_NIL", -} - -/** - * Commit contains the evidence that a block was committed by a set of validators. - */ -export interface TypesCommit { - /** @format int64 */ - height?: string; - - /** @format int32 */ - round?: number; - block_id?: TypesBlockID; - signatures?: TypesCommitSig[]; -} - -/** - * CommitSig is a part of the Vote included in a Commit. - */ -export interface TypesCommitSig { - block_id_flag?: TypesBlockIDFlag; - - /** @format byte */ - validator_address?: string; - - /** @format date-time */ - timestamp?: string; - - /** @format byte */ - signature?: string; -} - -export interface TypesData { - /** - * Txs that will be applied by state @ block.Height+1. - * NOTE: not all txs here are valid. We're just agreeing on the order first. - * This means that block.AppHash does not include these txs. - */ - txs?: string[]; -} - -/** - * DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. - */ -export interface TypesDuplicateVoteEvidence { - /** - * Vote represents a prevote, precommit, or commit vote from validators for - * consensus. - */ - vote_a?: TypesVote; - - /** - * Vote represents a prevote, precommit, or commit vote from validators for - * consensus. - */ - vote_b?: TypesVote; - - /** @format int64 */ - total_voting_power?: string; - - /** @format int64 */ - validator_power?: string; - - /** @format date-time */ - timestamp?: string; -} - -export interface TypesEvidence { - /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ - duplicate_vote_evidence?: TypesDuplicateVoteEvidence; - - /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ - light_client_attack_evidence?: TypesLightClientAttackEvidence; -} - -export interface TypesEvidenceList { - evidence?: TypesEvidence[]; -} - -/** - * Header defines the structure of a Tendermint block header. - */ -export interface TypesHeader { - /** - * Consensus captures the consensus rules for processing a block in the blockchain, - * including all blockchain data structures and the rules of the application's - * state transition machine. - */ - version?: VersionConsensus; - chain_id?: string; - - /** @format int64 */ - height?: string; - - /** @format date-time */ - time?: string; - last_block_id?: TypesBlockID; - - /** @format byte */ - last_commit_hash?: string; - - /** @format byte */ - data_hash?: string; - - /** @format byte */ - validators_hash?: string; - - /** @format byte */ - next_validators_hash?: string; - - /** @format byte */ - consensus_hash?: string; - - /** @format byte */ - app_hash?: string; - - /** @format byte */ - last_results_hash?: string; - - /** @format byte */ - evidence_hash?: string; - - /** @format byte */ - proposer_address?: string; -} - -export interface TypesLightBlock { - signed_header?: TypesSignedHeader; - validator_set?: TypesValidatorSet; -} - -/** - * LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. - */ -export interface TypesLightClientAttackEvidence { - conflicting_block?: TypesLightBlock; - - /** @format int64 */ - common_height?: string; - byzantine_validators?: TenderminttypesValidator[]; - - /** @format int64 */ - total_voting_power?: string; - - /** @format date-time */ - timestamp?: string; -} - -export interface TypesPartSetHeader { - /** @format int64 */ - total?: number; - - /** @format byte */ - hash?: string; -} - -export interface TypesSignedHeader { - /** Header defines the structure of a Tendermint block header. */ - header?: TypesHeader; - - /** Commit contains the evidence that a block was committed by a set of validators. */ - commit?: TypesCommit; -} - -/** -* SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals -*/ -export enum TypesSignedMsgType { - SIGNED_MSG_TYPE_UNKNOWN = "SIGNED_MSG_TYPE_UNKNOWN", - SIGNED_MSG_TYPE_PREVOTE = "SIGNED_MSG_TYPE_PREVOTE", - SIGNED_MSG_TYPE_PRECOMMIT = "SIGNED_MSG_TYPE_PRECOMMIT", - SIGNED_MSG_TYPE_PROPOSAL = "SIGNED_MSG_TYPE_PROPOSAL", -} - -export interface TypesValidatorSet { - validators?: TenderminttypesValidator[]; - proposer?: TenderminttypesValidator; - - /** @format int64 */ - total_voting_power?: string; -} - -/** -* Vote represents a prevote, precommit, or commit vote from validators for -consensus. -*/ -export interface TypesVote { - /** - * SignedMsgType is a type of signed message in the consensus. - * - * - SIGNED_MSG_TYPE_PREVOTE: Votes - * - SIGNED_MSG_TYPE_PROPOSAL: Proposals - */ - type?: TypesSignedMsgType; - - /** @format int64 */ - height?: string; - - /** @format int32 */ - round?: number; - block_id?: TypesBlockID; - - /** @format date-time */ - timestamp?: string; - - /** @format byte */ - validator_address?: string; - - /** @format int32 */ - validator_index?: number; - - /** @format byte */ - signature?: string; -} - -/** - * GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. - */ -export interface V1Beta1GetBlockByHeightResponse { - block_id?: TypesBlockID; - block?: TypesBlock; -} - -/** - * GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. - */ -export interface V1Beta1GetLatestBlockResponse { - block_id?: TypesBlockID; - block?: TypesBlock; -} - -/** - * GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. - */ -export interface V1Beta1GetLatestValidatorSetResponse { - /** @format int64 */ - block_height?: string; - validators?: Tendermintv1Beta1Validator[]; - - /** pagination defines an pagination for the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. - */ -export interface V1Beta1GetNodeInfoResponse { - default_node_info?: P2PDefaultNodeInfo; - - /** VersionInfo is the type for the GetNodeInfoResponse message. */ - application_version?: V1Beta1VersionInfo; -} - -/** - * GetSyncingResponse is the response type for the Query/GetSyncing RPC method. - */ -export interface V1Beta1GetSyncingResponse { - syncing?: boolean; -} - -/** - * GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. - */ -export interface V1Beta1GetValidatorSetByHeightResponse { - /** @format int64 */ - block_height?: string; - validators?: Tendermintv1Beta1Validator[]; - - /** pagination defines an pagination for the response. */ - pagination?: V1Beta1PageResponse; -} - -export interface V1Beta1Module { - path?: string; - version?: string; - sum?: string; -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * VersionInfo is the type for the GetNodeInfoResponse message. - */ -export interface V1Beta1VersionInfo { - name?: string; - app_name?: string; - version?: string; - git_commit?: string; - build_tags?: string; - go_version?: string; - build_deps?: V1Beta1Module[]; - cosmos_sdk_version?: string; -} - -/** -* Consensus captures the consensus rules for processing a block in the blockchain, -including all blockchain data structures and the rules of the application's -state transition machine. -*/ -export interface VersionConsensus { - /** @format uint64 */ - block?: string; - - /** @format uint64 */ - app?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/base/tendermint/v1beta1/query.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Service - * @name ServiceGetLatestBlock - * @summary GetLatestBlock returns the latest block. - * @request GET:/cosmos/base/tendermint/v1beta1/blocks/latest - */ - serviceGetLatestBlock = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/base/tendermint/v1beta1/blocks/latest`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Service - * @name ServiceGetBlockByHeight - * @summary GetBlockByHeight queries block for given height. - * @request GET:/cosmos/base/tendermint/v1beta1/blocks/{height} - */ - serviceGetBlockByHeight = (height: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/base/tendermint/v1beta1/blocks/${height}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Service - * @name ServiceGetNodeInfo - * @summary GetNodeInfo queries the current node info. - * @request GET:/cosmos/base/tendermint/v1beta1/node_info - */ - serviceGetNodeInfo = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/base/tendermint/v1beta1/node_info`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Service - * @name ServiceGetSyncing - * @summary GetSyncing queries node syncing. - * @request GET:/cosmos/base/tendermint/v1beta1/syncing - */ - serviceGetSyncing = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/base/tendermint/v1beta1/syncing`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Service - * @name ServiceGetLatestValidatorSet - * @summary GetLatestValidatorSet queries latest validator-set. - * @request GET:/cosmos/base/tendermint/v1beta1/validatorsets/latest - */ - serviceGetLatestValidatorSet = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/base/tendermint/v1beta1/validatorsets/latest`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Service - * @name ServiceGetValidatorSetByHeight - * @summary GetValidatorSetByHeight queries validator-set at a given height. - * @request GET:/cosmos/base/tendermint/v1beta1/validatorsets/{height} - */ - serviceGetValidatorSetByHeight = ( - height: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/base/tendermint/v1beta1/validatorsets/${height}`, - method: "GET", - query: query, - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/cosmos/base/tendermint/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/cosmos/base/tendermint/v1beta1/query.ts deleted file mode 100644 index f06a1f70..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/cosmos/base/tendermint/v1beta1/query.ts +++ /dev/null @@ -1,1584 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - PageRequest, - PageResponse, -} from "../../../../cosmos/base/query/v1beta1/pagination"; -import { Any } from "../../../../google/protobuf/any"; -import { BlockID } from "../../../../tendermint/types/types"; -import { Block } from "../../../../tendermint/types/block"; -import { DefaultNodeInfo } from "../../../../tendermint/p2p/types"; - -export const protobufPackage = "cosmos.base.tendermint.v1beta1"; - -/** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ -export interface GetValidatorSetByHeightRequest { - height: number; - /** pagination defines an pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ -export interface GetValidatorSetByHeightResponse { - block_height: number; - validators: Validator[]; - /** pagination defines an pagination for the response. */ - pagination: PageResponse | undefined; -} - -/** GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ -export interface GetLatestValidatorSetRequest { - /** pagination defines an pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ -export interface GetLatestValidatorSetResponse { - block_height: number; - validators: Validator[]; - /** pagination defines an pagination for the response. */ - pagination: PageResponse | undefined; -} - -/** Validator is the type for the validator-set. */ -export interface Validator { - address: string; - pub_key: Any | undefined; - voting_power: number; - proposer_priority: number; -} - -/** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */ -export interface GetBlockByHeightRequest { - height: number; -} - -/** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ -export interface GetBlockByHeightResponse { - block_id: BlockID | undefined; - block: Block | undefined; -} - -/** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ -export interface GetLatestBlockRequest {} - -/** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ -export interface GetLatestBlockResponse { - block_id: BlockID | undefined; - block: Block | undefined; -} - -/** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ -export interface GetSyncingRequest {} - -/** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */ -export interface GetSyncingResponse { - syncing: boolean; -} - -/** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ -export interface GetNodeInfoRequest {} - -/** GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. */ -export interface GetNodeInfoResponse { - default_node_info: DefaultNodeInfo | undefined; - application_version: VersionInfo | undefined; -} - -/** VersionInfo is the type for the GetNodeInfoResponse message. */ -export interface VersionInfo { - name: string; - app_name: string; - version: string; - git_commit: string; - build_tags: string; - go_version: string; - build_deps: Module[]; - /** Since: cosmos-sdk 0.43 */ - cosmos_sdk_version: string; -} - -/** Module is the type for VersionInfo */ -export interface Module { - /** module path */ - path: string; - /** module version */ - version: string; - /** checksum */ - sum: string; -} - -const baseGetValidatorSetByHeightRequest: object = { height: 0 }; - -export const GetValidatorSetByHeightRequest = { - encode( - message: GetValidatorSetByHeightRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GetValidatorSetByHeightRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetValidatorSetByHeightRequest, - } as GetValidatorSetByHeightRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetValidatorSetByHeightRequest { - const message = { - ...baseGetValidatorSetByHeightRequest, - } as GetValidatorSetByHeightRequest; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: GetValidatorSetByHeightRequest): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GetValidatorSetByHeightRequest { - const message = { - ...baseGetValidatorSetByHeightRequest, - } as GetValidatorSetByHeightRequest; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseGetValidatorSetByHeightResponse: object = { block_height: 0 }; - -export const GetValidatorSetByHeightResponse = { - encode( - message: GetValidatorSetByHeightResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.block_height !== 0) { - writer.uint32(8).int64(message.block_height); - } - for (const v of message.validators) { - Validator.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GetValidatorSetByHeightResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetValidatorSetByHeightResponse, - } as GetValidatorSetByHeightResponse; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_height = longToNumber(reader.int64() as Long); - break; - case 2: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; - case 3: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetValidatorSetByHeightResponse { - const message = { - ...baseGetValidatorSetByHeightResponse, - } as GetValidatorSetByHeightResponse; - message.validators = []; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = Number(object.block_height); - } else { - message.block_height = 0; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: GetValidatorSetByHeightResponse): unknown { - const obj: any = {}; - message.block_height !== undefined && - (obj.block_height = message.block_height); - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GetValidatorSetByHeightResponse { - const message = { - ...baseGetValidatorSetByHeightResponse, - } as GetValidatorSetByHeightResponse; - message.validators = []; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = object.block_height; - } else { - message.block_height = 0; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseGetLatestValidatorSetRequest: object = {}; - -export const GetLatestValidatorSetRequest = { - encode( - message: GetLatestValidatorSetRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GetLatestValidatorSetRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetLatestValidatorSetRequest, - } as GetLatestValidatorSetRequest; - 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): GetLatestValidatorSetRequest { - const message = { - ...baseGetLatestValidatorSetRequest, - } as GetLatestValidatorSetRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: GetLatestValidatorSetRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GetLatestValidatorSetRequest { - const message = { - ...baseGetLatestValidatorSetRequest, - } as GetLatestValidatorSetRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseGetLatestValidatorSetResponse: object = { block_height: 0 }; - -export const GetLatestValidatorSetResponse = { - encode( - message: GetLatestValidatorSetResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.block_height !== 0) { - writer.uint32(8).int64(message.block_height); - } - for (const v of message.validators) { - Validator.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GetLatestValidatorSetResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetLatestValidatorSetResponse, - } as GetLatestValidatorSetResponse; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_height = longToNumber(reader.int64() as Long); - break; - case 2: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; - case 3: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetLatestValidatorSetResponse { - const message = { - ...baseGetLatestValidatorSetResponse, - } as GetLatestValidatorSetResponse; - message.validators = []; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = Number(object.block_height); - } else { - message.block_height = 0; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: GetLatestValidatorSetResponse): unknown { - const obj: any = {}; - message.block_height !== undefined && - (obj.block_height = message.block_height); - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GetLatestValidatorSetResponse { - const message = { - ...baseGetLatestValidatorSetResponse, - } as GetLatestValidatorSetResponse; - message.validators = []; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = object.block_height; - } else { - message.block_height = 0; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseValidator: object = { - address: "", - voting_power: 0, - proposer_priority: 0, -}; - -export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.pub_key !== undefined) { - Any.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); - } - if (message.voting_power !== 0) { - writer.uint32(24).int64(message.voting_power); - } - if (message.proposer_priority !== 0) { - writer.uint32(32).int64(message.proposer_priority); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.pub_key = Any.decode(reader, reader.uint32()); - break; - case 3: - message.voting_power = longToNumber(reader.int64() as Long); - break; - case 4: - message.proposer_priority = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = Number(object.proposer_priority); - } else { - message.proposer_priority = 0; - } - return message; - }, - - toJSON(message: Validator): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key ? Any.toJSON(message.pub_key) : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - message.proposer_priority !== undefined && - (obj.proposer_priority = message.proposer_priority); - return obj; - }, - - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = object.proposer_priority; - } else { - message.proposer_priority = 0; - } - return message; - }, -}; - -const baseGetBlockByHeightRequest: object = { height: 0 }; - -export const GetBlockByHeightRequest = { - encode( - message: GetBlockByHeightRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetBlockByHeightRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetBlockByHeightRequest, - } as GetBlockByHeightRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetBlockByHeightRequest { - const message = { - ...baseGetBlockByHeightRequest, - } as GetBlockByHeightRequest; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; - }, - - toJSON(message: GetBlockByHeightRequest): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GetBlockByHeightRequest { - const message = { - ...baseGetBlockByHeightRequest, - } as GetBlockByHeightRequest; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - return message; - }, -}; - -const baseGetBlockByHeightResponse: object = {}; - -export const GetBlockByHeightResponse = { - encode( - message: GetBlockByHeightResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); - } - if (message.block !== undefined) { - Block.encode(message.block, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GetBlockByHeightResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetBlockByHeightResponse, - } as GetBlockByHeightResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 2: - message.block = Block.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetBlockByHeightResponse { - const message = { - ...baseGetBlockByHeightResponse, - } as GetBlockByHeightResponse; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromJSON(object.block); - } else { - message.block = undefined; - } - return message; - }, - - toJSON(message: GetBlockByHeightResponse): unknown { - const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block !== undefined && - (obj.block = message.block ? Block.toJSON(message.block) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GetBlockByHeightResponse { - const message = { - ...baseGetBlockByHeightResponse, - } as GetBlockByHeightResponse; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromPartial(object.block); - } else { - message.block = undefined; - } - return message; - }, -}; - -const baseGetLatestBlockRequest: object = {}; - -export const GetLatestBlockRequest = { - encode(_: GetLatestBlockRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetLatestBlockRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): GetLatestBlockRequest { - const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; - return message; - }, - - toJSON(_: GetLatestBlockRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): GetLatestBlockRequest { - const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; - return message; - }, -}; - -const baseGetLatestBlockResponse: object = {}; - -export const GetLatestBlockResponse = { - encode( - message: GetLatestBlockResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); - } - if (message.block !== undefined) { - Block.encode(message.block, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetLatestBlockResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 2: - message.block = Block.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetLatestBlockResponse { - const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromJSON(object.block); - } else { - message.block = undefined; - } - return message; - }, - - toJSON(message: GetLatestBlockResponse): unknown { - const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block !== undefined && - (obj.block = message.block ? Block.toJSON(message.block) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GetLatestBlockResponse { - const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromPartial(object.block); - } else { - message.block = undefined; - } - return message; - }, -}; - -const baseGetSyncingRequest: object = {}; - -export const GetSyncingRequest = { - encode(_: GetSyncingRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetSyncingRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetSyncingRequest } as GetSyncingRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): GetSyncingRequest { - const message = { ...baseGetSyncingRequest } as GetSyncingRequest; - return message; - }, - - toJSON(_: GetSyncingRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): GetSyncingRequest { - const message = { ...baseGetSyncingRequest } as GetSyncingRequest; - return message; - }, -}; - -const baseGetSyncingResponse: object = { syncing: false }; - -export const GetSyncingResponse = { - encode( - message: GetSyncingResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.syncing === true) { - writer.uint32(8).bool(message.syncing); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetSyncingResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetSyncingResponse } as GetSyncingResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.syncing = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetSyncingResponse { - const message = { ...baseGetSyncingResponse } as GetSyncingResponse; - if (object.syncing !== undefined && object.syncing !== null) { - message.syncing = Boolean(object.syncing); - } else { - message.syncing = false; - } - return message; - }, - - toJSON(message: GetSyncingResponse): unknown { - const obj: any = {}; - message.syncing !== undefined && (obj.syncing = message.syncing); - return obj; - }, - - fromPartial(object: DeepPartial): GetSyncingResponse { - const message = { ...baseGetSyncingResponse } as GetSyncingResponse; - if (object.syncing !== undefined && object.syncing !== null) { - message.syncing = object.syncing; - } else { - message.syncing = false; - } - return message; - }, -}; - -const baseGetNodeInfoRequest: object = {}; - -export const GetNodeInfoRequest = { - encode(_: GetNodeInfoRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetNodeInfoRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): GetNodeInfoRequest { - const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; - return message; - }, - - toJSON(_: GetNodeInfoRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): GetNodeInfoRequest { - const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; - return message; - }, -}; - -const baseGetNodeInfoResponse: object = {}; - -export const GetNodeInfoResponse = { - encode( - message: GetNodeInfoResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.default_node_info !== undefined) { - DefaultNodeInfo.encode( - message.default_node_info, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.application_version !== undefined) { - VersionInfo.encode( - message.application_version, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetNodeInfoResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.default_node_info = DefaultNodeInfo.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.application_version = VersionInfo.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetNodeInfoResponse { - const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; - if ( - object.default_node_info !== undefined && - object.default_node_info !== null - ) { - message.default_node_info = DefaultNodeInfo.fromJSON( - object.default_node_info - ); - } else { - message.default_node_info = undefined; - } - if ( - object.application_version !== undefined && - object.application_version !== null - ) { - message.application_version = VersionInfo.fromJSON( - object.application_version - ); - } else { - message.application_version = undefined; - } - return message; - }, - - toJSON(message: GetNodeInfoResponse): unknown { - const obj: any = {}; - message.default_node_info !== undefined && - (obj.default_node_info = message.default_node_info - ? DefaultNodeInfo.toJSON(message.default_node_info) - : undefined); - message.application_version !== undefined && - (obj.application_version = message.application_version - ? VersionInfo.toJSON(message.application_version) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GetNodeInfoResponse { - const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; - if ( - object.default_node_info !== undefined && - object.default_node_info !== null - ) { - message.default_node_info = DefaultNodeInfo.fromPartial( - object.default_node_info - ); - } else { - message.default_node_info = undefined; - } - if ( - object.application_version !== undefined && - object.application_version !== null - ) { - message.application_version = VersionInfo.fromPartial( - object.application_version - ); - } else { - message.application_version = undefined; - } - return message; - }, -}; - -const baseVersionInfo: object = { - name: "", - app_name: "", - version: "", - git_commit: "", - build_tags: "", - go_version: "", - cosmos_sdk_version: "", -}; - -export const VersionInfo = { - encode(message: VersionInfo, writer: Writer = Writer.create()): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.app_name !== "") { - writer.uint32(18).string(message.app_name); - } - if (message.version !== "") { - writer.uint32(26).string(message.version); - } - if (message.git_commit !== "") { - writer.uint32(34).string(message.git_commit); - } - if (message.build_tags !== "") { - writer.uint32(42).string(message.build_tags); - } - if (message.go_version !== "") { - writer.uint32(50).string(message.go_version); - } - for (const v of message.build_deps) { - Module.encode(v!, writer.uint32(58).fork()).ldelim(); - } - if (message.cosmos_sdk_version !== "") { - writer.uint32(66).string(message.cosmos_sdk_version); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): VersionInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVersionInfo } as VersionInfo; - message.build_deps = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.app_name = reader.string(); - break; - case 3: - message.version = reader.string(); - break; - case 4: - message.git_commit = reader.string(); - break; - case 5: - message.build_tags = reader.string(); - break; - case 6: - message.go_version = reader.string(); - break; - case 7: - message.build_deps.push(Module.decode(reader, reader.uint32())); - break; - case 8: - message.cosmos_sdk_version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): VersionInfo { - const message = { ...baseVersionInfo } as VersionInfo; - message.build_deps = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.app_name !== undefined && object.app_name !== null) { - message.app_name = String(object.app_name); - } else { - message.app_name = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.git_commit !== undefined && object.git_commit !== null) { - message.git_commit = String(object.git_commit); - } else { - message.git_commit = ""; - } - if (object.build_tags !== undefined && object.build_tags !== null) { - message.build_tags = String(object.build_tags); - } else { - message.build_tags = ""; - } - if (object.go_version !== undefined && object.go_version !== null) { - message.go_version = String(object.go_version); - } else { - message.go_version = ""; - } - if (object.build_deps !== undefined && object.build_deps !== null) { - for (const e of object.build_deps) { - message.build_deps.push(Module.fromJSON(e)); - } - } - if ( - object.cosmos_sdk_version !== undefined && - object.cosmos_sdk_version !== null - ) { - message.cosmos_sdk_version = String(object.cosmos_sdk_version); - } else { - message.cosmos_sdk_version = ""; - } - return message; - }, - - toJSON(message: VersionInfo): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.app_name !== undefined && (obj.app_name = message.app_name); - message.version !== undefined && (obj.version = message.version); - message.git_commit !== undefined && (obj.git_commit = message.git_commit); - message.build_tags !== undefined && (obj.build_tags = message.build_tags); - message.go_version !== undefined && (obj.go_version = message.go_version); - if (message.build_deps) { - obj.build_deps = message.build_deps.map((e) => - e ? Module.toJSON(e) : undefined - ); - } else { - obj.build_deps = []; - } - message.cosmos_sdk_version !== undefined && - (obj.cosmos_sdk_version = message.cosmos_sdk_version); - return obj; - }, - - fromPartial(object: DeepPartial): VersionInfo { - const message = { ...baseVersionInfo } as VersionInfo; - message.build_deps = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.app_name !== undefined && object.app_name !== null) { - message.app_name = object.app_name; - } else { - message.app_name = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.git_commit !== undefined && object.git_commit !== null) { - message.git_commit = object.git_commit; - } else { - message.git_commit = ""; - } - if (object.build_tags !== undefined && object.build_tags !== null) { - message.build_tags = object.build_tags; - } else { - message.build_tags = ""; - } - if (object.go_version !== undefined && object.go_version !== null) { - message.go_version = object.go_version; - } else { - message.go_version = ""; - } - if (object.build_deps !== undefined && object.build_deps !== null) { - for (const e of object.build_deps) { - message.build_deps.push(Module.fromPartial(e)); - } - } - if ( - object.cosmos_sdk_version !== undefined && - object.cosmos_sdk_version !== null - ) { - message.cosmos_sdk_version = object.cosmos_sdk_version; - } else { - message.cosmos_sdk_version = ""; - } - return message; - }, -}; - -const baseModule: object = { path: "", version: "", sum: "" }; - -export const Module = { - encode(message: Module, writer: Writer = Writer.create()): Writer { - if (message.path !== "") { - writer.uint32(10).string(message.path); - } - if (message.version !== "") { - writer.uint32(18).string(message.version); - } - if (message.sum !== "") { - writer.uint32(26).string(message.sum); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Module { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModule } as Module; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - case 3: - message.sum = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Module { - const message = { ...baseModule } as Module; - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.sum !== undefined && object.sum !== null) { - message.sum = String(object.sum); - } else { - message.sum = ""; - } - return message; - }, - - toJSON(message: Module): unknown { - const obj: any = {}; - message.path !== undefined && (obj.path = message.path); - message.version !== undefined && (obj.version = message.version); - message.sum !== undefined && (obj.sum = message.sum); - return obj; - }, - - fromPartial(object: DeepPartial): Module { - const message = { ...baseModule } as Module; - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.sum !== undefined && object.sum !== null) { - message.sum = object.sum; - } else { - message.sum = ""; - } - return message; - }, -}; - -/** Service defines the gRPC querier service for tendermint queries. */ -export interface Service { - /** GetNodeInfo queries the current node info. */ - GetNodeInfo(request: GetNodeInfoRequest): Promise; - /** GetSyncing queries node syncing. */ - GetSyncing(request: GetSyncingRequest): Promise; - /** GetLatestBlock returns the latest block. */ - GetLatestBlock( - request: GetLatestBlockRequest - ): Promise; - /** GetBlockByHeight queries block for given height. */ - GetBlockByHeight( - request: GetBlockByHeightRequest - ): Promise; - /** GetLatestValidatorSet queries latest validator-set. */ - GetLatestValidatorSet( - request: GetLatestValidatorSetRequest - ): Promise; - /** GetValidatorSetByHeight queries validator-set at a given height. */ - GetValidatorSetByHeight( - request: GetValidatorSetByHeightRequest - ): Promise; -} - -export class ServiceClientImpl implements Service { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - GetNodeInfo(request: GetNodeInfoRequest): Promise { - const data = GetNodeInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetNodeInfo", - data - ); - return promise.then((data) => GetNodeInfoResponse.decode(new Reader(data))); - } - - GetSyncing(request: GetSyncingRequest): Promise { - const data = GetSyncingRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetSyncing", - data - ); - return promise.then((data) => GetSyncingResponse.decode(new Reader(data))); - } - - GetLatestBlock( - request: GetLatestBlockRequest - ): Promise { - const data = GetLatestBlockRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetLatestBlock", - data - ); - return promise.then((data) => - GetLatestBlockResponse.decode(new Reader(data)) - ); - } - - GetBlockByHeight( - request: GetBlockByHeightRequest - ): Promise { - const data = GetBlockByHeightRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetBlockByHeight", - data - ); - return promise.then((data) => - GetBlockByHeightResponse.decode(new Reader(data)) - ); - } - - GetLatestValidatorSet( - request: GetLatestValidatorSetRequest - ): Promise { - const data = GetLatestValidatorSetRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetLatestValidatorSet", - data - ); - return promise.then((data) => - GetLatestValidatorSetResponse.decode(new Reader(data)) - ); - } - - GetValidatorSetByHeight( - request: GetValidatorSetByHeightRequest - ): Promise { - const data = GetValidatorSetByHeightRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetValidatorSetByHeight", - data - ); - return promise.then((data) => - GetValidatorSetByHeightResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/crypto/keys.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/crypto/keys.ts deleted file mode 100644 index 450db2a1..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/crypto/keys.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.crypto"; - -/** PublicKey defines the keys available for use with Tendermint Validators */ -export interface PublicKey { - ed25519: Uint8Array | undefined; - secp256k1: Uint8Array | undefined; -} - -const basePublicKey: object = {}; - -export const PublicKey = { - encode(message: PublicKey, writer: Writer = Writer.create()): Writer { - if (message.ed25519 !== undefined) { - writer.uint32(10).bytes(message.ed25519); - } - if (message.secp256k1 !== undefined) { - writer.uint32(18).bytes(message.secp256k1); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PublicKey { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePublicKey } as PublicKey; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ed25519 = reader.bytes(); - break; - case 2: - message.secp256k1 = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = bytesFromBase64(object.ed25519); - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = bytesFromBase64(object.secp256k1); - } - return message; - }, - - toJSON(message: PublicKey): unknown { - const obj: any = {}; - message.ed25519 !== undefined && - (obj.ed25519 = - message.ed25519 !== undefined - ? base64FromBytes(message.ed25519) - : undefined); - message.secp256k1 !== undefined && - (obj.secp256k1 = - message.secp256k1 !== undefined - ? base64FromBytes(message.secp256k1) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = object.ed25519; - } else { - message.ed25519 = undefined; - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = object.secp256k1; - } else { - message.secp256k1 = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/crypto/proof.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/crypto/proof.ts deleted file mode 100644 index db058694..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/crypto/proof.ts +++ /dev/null @@ -1,529 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.crypto"; - -export interface Proof { - total: number; - index: number; - leaf_hash: Uint8Array; - aunts: Uint8Array[]; -} - -export interface ValueOp { - /** Encoded in ProofOp.Key. */ - key: Uint8Array; - /** To encode in ProofOp.Data */ - proof: Proof | undefined; -} - -export interface DominoOp { - key: string; - input: string; - output: string; -} - -/** - * ProofOp defines an operation used for calculating Merkle root - * The data could be arbitrary format, providing nessecary data - * for example neighbouring node hash - */ -export interface ProofOp { - type: string; - key: Uint8Array; - data: Uint8Array; -} - -/** ProofOps is Merkle proof defined by the list of ProofOps */ -export interface ProofOps { - ops: ProofOp[]; -} - -const baseProof: object = { total: 0, index: 0 }; - -export const Proof = { - encode(message: Proof, writer: Writer = Writer.create()): Writer { - if (message.total !== 0) { - writer.uint32(8).int64(message.total); - } - if (message.index !== 0) { - writer.uint32(16).int64(message.index); - } - if (message.leaf_hash.length !== 0) { - writer.uint32(26).bytes(message.leaf_hash); - } - for (const v of message.aunts) { - writer.uint32(34).bytes(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Proof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProof } as Proof; - message.aunts = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = longToNumber(reader.int64() as Long); - break; - case 2: - message.index = longToNumber(reader.int64() as Long); - break; - case 3: - message.leaf_hash = reader.bytes(); - break; - case 4: - message.aunts.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = bytesFromBase64(object.leaf_hash); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(bytesFromBase64(e)); - } - } - return message; - }, - - toJSON(message: Proof): unknown { - const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.index !== undefined && (obj.index = message.index); - message.leaf_hash !== undefined && - (obj.leaf_hash = base64FromBytes( - message.leaf_hash !== undefined ? message.leaf_hash : new Uint8Array() - )); - if (message.aunts) { - obj.aunts = message.aunts.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.aunts = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = object.leaf_hash; - } else { - message.leaf_hash = new Uint8Array(); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(e); - } - } - return message; - }, -}; - -const baseValueOp: object = {}; - -export const ValueOp = { - encode(message: ValueOp, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValueOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValueOp } as ValueOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.proof = Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; - }, - - toJSON(message: ValueOp): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } - return message; - }, -}; - -const baseDominoOp: object = { key: "", input: "", output: "" }; - -export const DominoOp = { - encode(message: DominoOp, writer: Writer = Writer.create()): Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.input !== "") { - writer.uint32(18).string(message.input); - } - if (message.output !== "") { - writer.uint32(26).string(message.output); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DominoOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDominoOp } as DominoOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.input = reader.string(); - break; - case 3: - message.output = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = String(object.input); - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = String(object.output); - } else { - message.output = ""; - } - return message; - }, - - toJSON(message: DominoOp): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.input !== undefined && (obj.input = message.input); - message.output !== undefined && (obj.output = message.output); - return obj; - }, - - fromPartial(object: DeepPartial): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = object.input; - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = object.output; - } else { - message.output = ""; - } - return message; - }, -}; - -const baseProofOp: object = { type: "" }; - -export const ProofOp = { - encode(message: ProofOp, writer: Writer = Writer.create()): Writer { - if (message.type !== "") { - writer.uint32(10).string(message.type); - } - if (message.key.length !== 0) { - writer.uint32(18).bytes(message.key); - } - if (message.data.length !== 0) { - writer.uint32(26).bytes(message.data); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOp } as ProofOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.key = reader.bytes(); - break; - case 3: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - toJSON(message: ProofOp): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = message.type); - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, -}; - -const baseProofOps: object = {}; - -export const ProofOps = { - encode(message: ProofOps, writer: Writer = Writer.create()): Writer { - for (const v of message.ops) { - ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ops.push(ProofOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ProofOps): unknown { - const obj: any = {}; - if (message.ops) { - obj.ops = message.ops.map((e) => (e ? ProofOp.toJSON(e) : undefined)); - } else { - obj.ops = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromPartial(e)); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/p2p/types.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/p2p/types.ts deleted file mode 100644 index 919ca497..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/p2p/types.ts +++ /dev/null @@ -1,557 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.p2p"; - -export interface NetAddress { - id: string; - ip: string; - port: number; -} - -export interface ProtocolVersion { - p2p: number; - block: number; - app: number; -} - -export interface DefaultNodeInfo { - protocol_version: ProtocolVersion | undefined; - default_node_id: string; - listen_addr: string; - network: string; - version: string; - channels: Uint8Array; - moniker: string; - other: DefaultNodeInfoOther | undefined; -} - -export interface DefaultNodeInfoOther { - tx_index: string; - rpc_address: string; -} - -const baseNetAddress: object = { id: "", ip: "", port: 0 }; - -export const NetAddress = { - encode(message: NetAddress, writer: Writer = Writer.create()): Writer { - if (message.id !== "") { - writer.uint32(10).string(message.id); - } - if (message.ip !== "") { - writer.uint32(18).string(message.ip); - } - if (message.port !== 0) { - writer.uint32(24).uint32(message.port); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): NetAddress { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseNetAddress } as NetAddress; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.ip = reader.string(); - break; - case 3: - message.port = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): NetAddress { - const message = { ...baseNetAddress } as NetAddress; - if (object.id !== undefined && object.id !== null) { - message.id = String(object.id); - } else { - message.id = ""; - } - if (object.ip !== undefined && object.ip !== null) { - message.ip = String(object.ip); - } else { - message.ip = ""; - } - if (object.port !== undefined && object.port !== null) { - message.port = Number(object.port); - } else { - message.port = 0; - } - return message; - }, - - toJSON(message: NetAddress): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id); - message.ip !== undefined && (obj.ip = message.ip); - message.port !== undefined && (obj.port = message.port); - return obj; - }, - - fromPartial(object: DeepPartial): NetAddress { - const message = { ...baseNetAddress } as NetAddress; - if (object.id !== undefined && object.id !== null) { - message.id = object.id; - } else { - message.id = ""; - } - if (object.ip !== undefined && object.ip !== null) { - message.ip = object.ip; - } else { - message.ip = ""; - } - if (object.port !== undefined && object.port !== null) { - message.port = object.port; - } else { - message.port = 0; - } - return message; - }, -}; - -const baseProtocolVersion: object = { p2p: 0, block: 0, app: 0 }; - -export const ProtocolVersion = { - encode(message: ProtocolVersion, writer: Writer = Writer.create()): Writer { - if (message.p2p !== 0) { - writer.uint32(8).uint64(message.p2p); - } - if (message.block !== 0) { - writer.uint32(16).uint64(message.block); - } - if (message.app !== 0) { - writer.uint32(24).uint64(message.app); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ProtocolVersion { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProtocolVersion } as ProtocolVersion; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.p2p = longToNumber(reader.uint64() as Long); - break; - case 2: - message.block = longToNumber(reader.uint64() as Long); - break; - case 3: - message.app = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProtocolVersion { - const message = { ...baseProtocolVersion } as ProtocolVersion; - if (object.p2p !== undefined && object.p2p !== null) { - message.p2p = Number(object.p2p); - } else { - message.p2p = 0; - } - if (object.block !== undefined && object.block !== null) { - message.block = Number(object.block); - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = Number(object.app); - } else { - message.app = 0; - } - return message; - }, - - toJSON(message: ProtocolVersion): unknown { - const obj: any = {}; - message.p2p !== undefined && (obj.p2p = message.p2p); - message.block !== undefined && (obj.block = message.block); - message.app !== undefined && (obj.app = message.app); - return obj; - }, - - fromPartial(object: DeepPartial): ProtocolVersion { - const message = { ...baseProtocolVersion } as ProtocolVersion; - if (object.p2p !== undefined && object.p2p !== null) { - message.p2p = object.p2p; - } else { - message.p2p = 0; - } - if (object.block !== undefined && object.block !== null) { - message.block = object.block; - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = object.app; - } else { - message.app = 0; - } - return message; - }, -}; - -const baseDefaultNodeInfo: object = { - default_node_id: "", - listen_addr: "", - network: "", - version: "", - moniker: "", -}; - -export const DefaultNodeInfo = { - encode(message: DefaultNodeInfo, writer: Writer = Writer.create()): Writer { - if (message.protocol_version !== undefined) { - ProtocolVersion.encode( - message.protocol_version, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.default_node_id !== "") { - writer.uint32(18).string(message.default_node_id); - } - if (message.listen_addr !== "") { - writer.uint32(26).string(message.listen_addr); - } - if (message.network !== "") { - writer.uint32(34).string(message.network); - } - if (message.version !== "") { - writer.uint32(42).string(message.version); - } - if (message.channels.length !== 0) { - writer.uint32(50).bytes(message.channels); - } - if (message.moniker !== "") { - writer.uint32(58).string(message.moniker); - } - if (message.other !== undefined) { - DefaultNodeInfoOther.encode( - message.other, - writer.uint32(66).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DefaultNodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDefaultNodeInfo } as DefaultNodeInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.protocol_version = ProtocolVersion.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.default_node_id = reader.string(); - break; - case 3: - message.listen_addr = reader.string(); - break; - case 4: - message.network = reader.string(); - break; - case 5: - message.version = reader.string(); - break; - case 6: - message.channels = reader.bytes(); - break; - case 7: - message.moniker = reader.string(); - break; - case 8: - message.other = DefaultNodeInfoOther.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DefaultNodeInfo { - const message = { ...baseDefaultNodeInfo } as DefaultNodeInfo; - if ( - object.protocol_version !== undefined && - object.protocol_version !== null - ) { - message.protocol_version = ProtocolVersion.fromJSON( - object.protocol_version - ); - } else { - message.protocol_version = undefined; - } - if ( - object.default_node_id !== undefined && - object.default_node_id !== null - ) { - message.default_node_id = String(object.default_node_id); - } else { - message.default_node_id = ""; - } - if (object.listen_addr !== undefined && object.listen_addr !== null) { - message.listen_addr = String(object.listen_addr); - } else { - message.listen_addr = ""; - } - if (object.network !== undefined && object.network !== null) { - message.network = String(object.network); - } else { - message.network = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.channels !== undefined && object.channels !== null) { - message.channels = bytesFromBase64(object.channels); - } - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = String(object.moniker); - } else { - message.moniker = ""; - } - if (object.other !== undefined && object.other !== null) { - message.other = DefaultNodeInfoOther.fromJSON(object.other); - } else { - message.other = undefined; - } - return message; - }, - - toJSON(message: DefaultNodeInfo): unknown { - const obj: any = {}; - message.protocol_version !== undefined && - (obj.protocol_version = message.protocol_version - ? ProtocolVersion.toJSON(message.protocol_version) - : undefined); - message.default_node_id !== undefined && - (obj.default_node_id = message.default_node_id); - message.listen_addr !== undefined && - (obj.listen_addr = message.listen_addr); - message.network !== undefined && (obj.network = message.network); - message.version !== undefined && (obj.version = message.version); - message.channels !== undefined && - (obj.channels = base64FromBytes( - message.channels !== undefined ? message.channels : new Uint8Array() - )); - message.moniker !== undefined && (obj.moniker = message.moniker); - message.other !== undefined && - (obj.other = message.other - ? DefaultNodeInfoOther.toJSON(message.other) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): DefaultNodeInfo { - const message = { ...baseDefaultNodeInfo } as DefaultNodeInfo; - if ( - object.protocol_version !== undefined && - object.protocol_version !== null - ) { - message.protocol_version = ProtocolVersion.fromPartial( - object.protocol_version - ); - } else { - message.protocol_version = undefined; - } - if ( - object.default_node_id !== undefined && - object.default_node_id !== null - ) { - message.default_node_id = object.default_node_id; - } else { - message.default_node_id = ""; - } - if (object.listen_addr !== undefined && object.listen_addr !== null) { - message.listen_addr = object.listen_addr; - } else { - message.listen_addr = ""; - } - if (object.network !== undefined && object.network !== null) { - message.network = object.network; - } else { - message.network = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.channels !== undefined && object.channels !== null) { - message.channels = object.channels; - } else { - message.channels = new Uint8Array(); - } - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = object.moniker; - } else { - message.moniker = ""; - } - if (object.other !== undefined && object.other !== null) { - message.other = DefaultNodeInfoOther.fromPartial(object.other); - } else { - message.other = undefined; - } - return message; - }, -}; - -const baseDefaultNodeInfoOther: object = { tx_index: "", rpc_address: "" }; - -export const DefaultNodeInfoOther = { - encode( - message: DefaultNodeInfoOther, - writer: Writer = Writer.create() - ): Writer { - if (message.tx_index !== "") { - writer.uint32(10).string(message.tx_index); - } - if (message.rpc_address !== "") { - writer.uint32(18).string(message.rpc_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DefaultNodeInfoOther { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDefaultNodeInfoOther } as DefaultNodeInfoOther; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx_index = reader.string(); - break; - case 2: - message.rpc_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DefaultNodeInfoOther { - const message = { ...baseDefaultNodeInfoOther } as DefaultNodeInfoOther; - if (object.tx_index !== undefined && object.tx_index !== null) { - message.tx_index = String(object.tx_index); - } else { - message.tx_index = ""; - } - if (object.rpc_address !== undefined && object.rpc_address !== null) { - message.rpc_address = String(object.rpc_address); - } else { - message.rpc_address = ""; - } - return message; - }, - - toJSON(message: DefaultNodeInfoOther): unknown { - const obj: any = {}; - message.tx_index !== undefined && (obj.tx_index = message.tx_index); - message.rpc_address !== undefined && - (obj.rpc_address = message.rpc_address); - return obj; - }, - - fromPartial(object: DeepPartial): DefaultNodeInfoOther { - const message = { ...baseDefaultNodeInfoOther } as DefaultNodeInfoOther; - if (object.tx_index !== undefined && object.tx_index !== null) { - message.tx_index = object.tx_index; - } else { - message.tx_index = ""; - } - if (object.rpc_address !== undefined && object.rpc_address !== null) { - message.rpc_address = object.rpc_address; - } else { - message.rpc_address = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/block.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/block.ts deleted file mode 100644 index 8c97308f..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/block.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* eslint-disable */ -import { Header, Data, Commit } from "../../tendermint/types/types"; -import { EvidenceList } from "../../tendermint/types/evidence"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.types"; - -export interface Block { - header: Header | undefined; - data: Data | undefined; - evidence: EvidenceList | undefined; - last_commit: Commit | undefined; -} - -const baseBlock: object = {}; - -export const Block = { - encode(message: Block, writer: Writer = Writer.create()): Writer { - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(10).fork()).ldelim(); - } - if (message.data !== undefined) { - Data.encode(message.data, writer.uint32(18).fork()).ldelim(); - } - if (message.evidence !== undefined) { - EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim(); - } - if (message.last_commit !== undefined) { - Commit.encode(message.last_commit, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Block { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlock } as Block; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = Header.decode(reader, reader.uint32()); - break; - case 2: - message.data = Data.decode(reader, reader.uint32()); - break; - case 3: - message.evidence = EvidenceList.decode(reader, reader.uint32()); - break; - case 4: - message.last_commit = Commit.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Block { - const message = { ...baseBlock } as Block; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = Data.fromJSON(object.data); - } else { - message.data = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceList.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - if (object.last_commit !== undefined && object.last_commit !== null) { - message.last_commit = Commit.fromJSON(object.last_commit); - } else { - message.last_commit = undefined; - } - return message; - }, - - toJSON(message: Block): unknown { - const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.data !== undefined && - (obj.data = message.data ? Data.toJSON(message.data) : undefined); - message.evidence !== undefined && - (obj.evidence = message.evidence - ? EvidenceList.toJSON(message.evidence) - : undefined); - message.last_commit !== undefined && - (obj.last_commit = message.last_commit - ? Commit.toJSON(message.last_commit) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Block { - const message = { ...baseBlock } as Block; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = Data.fromPartial(object.data); - } else { - message.data = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceList.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } - if (object.last_commit !== undefined && object.last_commit !== null) { - message.last_commit = Commit.fromPartial(object.last_commit); - } else { - message.last_commit = undefined; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/evidence.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/evidence.ts deleted file mode 100644 index 17994953..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/evidence.ts +++ /dev/null @@ -1,611 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Vote, LightBlock } from "../../tendermint/types/types"; -import { Validator } from "../../tendermint/types/validator"; - -export const protobufPackage = "tendermint.types"; - -export interface Evidence { - duplicate_vote_evidence: DuplicateVoteEvidence | undefined; - light_client_attack_evidence: LightClientAttackEvidence | undefined; -} - -/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ -export interface DuplicateVoteEvidence { - vote_a: Vote | undefined; - vote_b: Vote | undefined; - total_voting_power: number; - validator_power: number; - timestamp: Date | undefined; -} - -/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ -export interface LightClientAttackEvidence { - conflicting_block: LightBlock | undefined; - common_height: number; - byzantine_validators: Validator[]; - total_voting_power: number; - timestamp: Date | undefined; -} - -export interface EvidenceList { - evidence: Evidence[]; -} - -const baseEvidence: object = {}; - -export const Evidence = { - encode(message: Evidence, writer: Writer = Writer.create()): Writer { - if (message.duplicate_vote_evidence !== undefined) { - DuplicateVoteEvidence.encode( - message.duplicate_vote_evidence, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.light_client_attack_evidence !== undefined) { - LightClientAttackEvidence.encode( - message.light_client_attack_evidence, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Evidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidence } as Evidence; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.duplicate_vote_evidence = DuplicateVoteEvidence.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.light_client_attack_evidence = LightClientAttackEvidence.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Evidence { - const message = { ...baseEvidence } as Evidence; - if ( - object.duplicate_vote_evidence !== undefined && - object.duplicate_vote_evidence !== null - ) { - message.duplicate_vote_evidence = DuplicateVoteEvidence.fromJSON( - object.duplicate_vote_evidence - ); - } else { - message.duplicate_vote_evidence = undefined; - } - if ( - object.light_client_attack_evidence !== undefined && - object.light_client_attack_evidence !== null - ) { - message.light_client_attack_evidence = LightClientAttackEvidence.fromJSON( - object.light_client_attack_evidence - ); - } else { - message.light_client_attack_evidence = undefined; - } - return message; - }, - - toJSON(message: Evidence): unknown { - const obj: any = {}; - message.duplicate_vote_evidence !== undefined && - (obj.duplicate_vote_evidence = message.duplicate_vote_evidence - ? DuplicateVoteEvidence.toJSON(message.duplicate_vote_evidence) - : undefined); - message.light_client_attack_evidence !== undefined && - (obj.light_client_attack_evidence = message.light_client_attack_evidence - ? LightClientAttackEvidence.toJSON(message.light_client_attack_evidence) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Evidence { - const message = { ...baseEvidence } as Evidence; - if ( - object.duplicate_vote_evidence !== undefined && - object.duplicate_vote_evidence !== null - ) { - message.duplicate_vote_evidence = DuplicateVoteEvidence.fromPartial( - object.duplicate_vote_evidence - ); - } else { - message.duplicate_vote_evidence = undefined; - } - if ( - object.light_client_attack_evidence !== undefined && - object.light_client_attack_evidence !== null - ) { - message.light_client_attack_evidence = LightClientAttackEvidence.fromPartial( - object.light_client_attack_evidence - ); - } else { - message.light_client_attack_evidence = undefined; - } - return message; - }, -}; - -const baseDuplicateVoteEvidence: object = { - total_voting_power: 0, - validator_power: 0, -}; - -export const DuplicateVoteEvidence = { - encode( - message: DuplicateVoteEvidence, - writer: Writer = Writer.create() - ): Writer { - if (message.vote_a !== undefined) { - Vote.encode(message.vote_a, writer.uint32(10).fork()).ldelim(); - } - if (message.vote_b !== undefined) { - Vote.encode(message.vote_b, writer.uint32(18).fork()).ldelim(); - } - if (message.total_voting_power !== 0) { - writer.uint32(24).int64(message.total_voting_power); - } - if (message.validator_power !== 0) { - writer.uint32(32).int64(message.validator_power); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DuplicateVoteEvidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.vote_a = Vote.decode(reader, reader.uint32()); - break; - case 2: - message.vote_b = Vote.decode(reader, reader.uint32()); - break; - case 3: - message.total_voting_power = longToNumber(reader.int64() as Long); - break; - case 4: - message.validator_power = longToNumber(reader.int64() as Long); - break; - case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DuplicateVoteEvidence { - const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; - if (object.vote_a !== undefined && object.vote_a !== null) { - message.vote_a = Vote.fromJSON(object.vote_a); - } else { - message.vote_a = undefined; - } - if (object.vote_b !== undefined && object.vote_b !== null) { - message.vote_b = Vote.fromJSON(object.vote_b); - } else { - message.vote_b = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - if ( - object.validator_power !== undefined && - object.validator_power !== null - ) { - message.validator_power = Number(object.validator_power); - } else { - message.validator_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - return message; - }, - - toJSON(message: DuplicateVoteEvidence): unknown { - const obj: any = {}; - message.vote_a !== undefined && - (obj.vote_a = message.vote_a ? Vote.toJSON(message.vote_a) : undefined); - message.vote_b !== undefined && - (obj.vote_b = message.vote_b ? Vote.toJSON(message.vote_b) : undefined); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - message.validator_power !== undefined && - (obj.validator_power = message.validator_power); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DuplicateVoteEvidence { - const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; - if (object.vote_a !== undefined && object.vote_a !== null) { - message.vote_a = Vote.fromPartial(object.vote_a); - } else { - message.vote_a = undefined; - } - if (object.vote_b !== undefined && object.vote_b !== null) { - message.vote_b = Vote.fromPartial(object.vote_b); - } else { - message.vote_b = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - if ( - object.validator_power !== undefined && - object.validator_power !== null - ) { - message.validator_power = object.validator_power; - } else { - message.validator_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - return message; - }, -}; - -const baseLightClientAttackEvidence: object = { - common_height: 0, - total_voting_power: 0, -}; - -export const LightClientAttackEvidence = { - encode( - message: LightClientAttackEvidence, - writer: Writer = Writer.create() - ): Writer { - if (message.conflicting_block !== undefined) { - LightBlock.encode( - message.conflicting_block, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.common_height !== 0) { - writer.uint32(16).int64(message.common_height); - } - for (const v of message.byzantine_validators) { - Validator.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.total_voting_power !== 0) { - writer.uint32(32).int64(message.total_voting_power); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): LightClientAttackEvidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseLightClientAttackEvidence, - } as LightClientAttackEvidence; - message.byzantine_validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.conflicting_block = LightBlock.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.common_height = longToNumber(reader.int64() as Long); - break; - case 3: - message.byzantine_validators.push( - Validator.decode(reader, reader.uint32()) - ); - break; - case 4: - message.total_voting_power = longToNumber(reader.int64() as Long); - break; - case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LightClientAttackEvidence { - const message = { - ...baseLightClientAttackEvidence, - } as LightClientAttackEvidence; - message.byzantine_validators = []; - if ( - object.conflicting_block !== undefined && - object.conflicting_block !== null - ) { - message.conflicting_block = LightBlock.fromJSON(object.conflicting_block); - } else { - message.conflicting_block = undefined; - } - if (object.common_height !== undefined && object.common_height !== null) { - message.common_height = Number(object.common_height); - } else { - message.common_height = 0; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Validator.fromJSON(e)); - } - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - return message; - }, - - toJSON(message: LightClientAttackEvidence): unknown { - const obj: any = {}; - message.conflicting_block !== undefined && - (obj.conflicting_block = message.conflicting_block - ? LightBlock.toJSON(message.conflicting_block) - : undefined); - message.common_height !== undefined && - (obj.common_height = message.common_height); - if (message.byzantine_validators) { - obj.byzantine_validators = message.byzantine_validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.byzantine_validators = []; - } - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - return obj; - }, - - fromPartial( - object: DeepPartial - ): LightClientAttackEvidence { - const message = { - ...baseLightClientAttackEvidence, - } as LightClientAttackEvidence; - message.byzantine_validators = []; - if ( - object.conflicting_block !== undefined && - object.conflicting_block !== null - ) { - message.conflicting_block = LightBlock.fromPartial( - object.conflicting_block - ); - } else { - message.conflicting_block = undefined; - } - if (object.common_height !== undefined && object.common_height !== null) { - message.common_height = object.common_height; - } else { - message.common_height = 0; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Validator.fromPartial(e)); - } - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - return message; - }, -}; - -const baseEvidenceList: object = {}; - -export const EvidenceList = { - encode(message: EvidenceList, writer: Writer = Writer.create()): Writer { - for (const v of message.evidence) { - Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EvidenceList { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidenceList } as EvidenceList; - message.evidence = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.evidence.push(Evidence.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EvidenceList { - const message = { ...baseEvidenceList } as EvidenceList; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Evidence.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EvidenceList): unknown { - const obj: any = {}; - if (message.evidence) { - obj.evidence = message.evidence.map((e) => - e ? Evidence.toJSON(e) : undefined - ); - } else { - obj.evidence = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EvidenceList { - const message = { ...baseEvidenceList } as EvidenceList; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Evidence.fromPartial(e)); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/types.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/types.ts deleted file mode 100644 index 59a41a8e..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/types.ts +++ /dev/null @@ -1,1943 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Proof } from "../../tendermint/crypto/proof"; -import { Consensus } from "../../tendermint/version/types"; -import { ValidatorSet } from "../../tendermint/types/validator"; - -export const protobufPackage = "tendermint.types"; - -/** BlockIdFlag indicates which BlcokID the signature is for */ -export enum BlockIDFlag { - BLOCK_ID_FLAG_UNKNOWN = 0, - BLOCK_ID_FLAG_ABSENT = 1, - BLOCK_ID_FLAG_COMMIT = 2, - BLOCK_ID_FLAG_NIL = 3, - UNRECOGNIZED = -1, -} - -export function blockIDFlagFromJSON(object: any): BlockIDFlag { - switch (object) { - case 0: - case "BLOCK_ID_FLAG_UNKNOWN": - return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; - case 1: - case "BLOCK_ID_FLAG_ABSENT": - return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; - case 2: - case "BLOCK_ID_FLAG_COMMIT": - return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; - case 3: - case "BLOCK_ID_FLAG_NIL": - return BlockIDFlag.BLOCK_ID_FLAG_NIL; - case -1: - case "UNRECOGNIZED": - default: - return BlockIDFlag.UNRECOGNIZED; - } -} - -export function blockIDFlagToJSON(object: BlockIDFlag): string { - switch (object) { - case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: - return "BLOCK_ID_FLAG_UNKNOWN"; - case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: - return "BLOCK_ID_FLAG_ABSENT"; - case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: - return "BLOCK_ID_FLAG_COMMIT"; - case BlockIDFlag.BLOCK_ID_FLAG_NIL: - return "BLOCK_ID_FLAG_NIL"; - default: - return "UNKNOWN"; - } -} - -/** SignedMsgType is a type of signed message in the consensus. */ -export enum SignedMsgType { - SIGNED_MSG_TYPE_UNKNOWN = 0, - /** SIGNED_MSG_TYPE_PREVOTE - Votes */ - SIGNED_MSG_TYPE_PREVOTE = 1, - SIGNED_MSG_TYPE_PRECOMMIT = 2, - /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */ - SIGNED_MSG_TYPE_PROPOSAL = 32, - UNRECOGNIZED = -1, -} - -export function signedMsgTypeFromJSON(object: any): SignedMsgType { - switch (object) { - case 0: - case "SIGNED_MSG_TYPE_UNKNOWN": - return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN; - case 1: - case "SIGNED_MSG_TYPE_PREVOTE": - return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE; - case 2: - case "SIGNED_MSG_TYPE_PRECOMMIT": - return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT; - case 32: - case "SIGNED_MSG_TYPE_PROPOSAL": - return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL; - case -1: - case "UNRECOGNIZED": - default: - return SignedMsgType.UNRECOGNIZED; - } -} - -export function signedMsgTypeToJSON(object: SignedMsgType): string { - switch (object) { - case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: - return "SIGNED_MSG_TYPE_UNKNOWN"; - case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: - return "SIGNED_MSG_TYPE_PREVOTE"; - case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: - return "SIGNED_MSG_TYPE_PRECOMMIT"; - case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: - return "SIGNED_MSG_TYPE_PROPOSAL"; - default: - return "UNKNOWN"; - } -} - -/** PartsetHeader */ -export interface PartSetHeader { - total: number; - hash: Uint8Array; -} - -export interface Part { - index: number; - bytes: Uint8Array; - proof: Proof | undefined; -} - -/** BlockID */ -export interface BlockID { - hash: Uint8Array; - part_set_header: PartSetHeader | undefined; -} - -/** Header defines the structure of a Tendermint block header. */ -export interface Header { - /** basic block info */ - version: Consensus | undefined; - chain_id: string; - height: number; - time: Date | undefined; - /** prev block info */ - last_block_id: BlockID | undefined; - /** hashes of block data */ - last_commit_hash: Uint8Array; - /** transactions */ - data_hash: Uint8Array; - /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; - /** validators for the next block */ - next_validators_hash: Uint8Array; - /** consensus params for current block */ - consensus_hash: Uint8Array; - /** state after txs from the previous block */ - app_hash: Uint8Array; - /** root hash of all results from the txs from the previous block */ - last_results_hash: Uint8Array; - /** consensus info */ - evidence_hash: Uint8Array; - /** original proposer of the block */ - proposer_address: Uint8Array; -} - -/** Data contains the set of transactions included in the block */ -export interface Data { - /** - * Txs that will be applied by state @ block.Height+1. - * NOTE: not all txs here are valid. We're just agreeing on the order first. - * This means that block.AppHash does not include these txs. - */ - txs: Uint8Array[]; -} - -/** - * Vote represents a prevote, precommit, or commit vote from validators for - * consensus. - */ -export interface Vote { - type: SignedMsgType; - height: number; - round: number; - /** zero if vote is nil. */ - block_id: BlockID | undefined; - timestamp: Date | undefined; - validator_address: Uint8Array; - validator_index: number; - signature: Uint8Array; -} - -/** Commit contains the evidence that a block was committed by a set of validators. */ -export interface Commit { - height: number; - round: number; - block_id: BlockID | undefined; - signatures: CommitSig[]; -} - -/** CommitSig is a part of the Vote included in a Commit. */ -export interface CommitSig { - block_id_flag: BlockIDFlag; - validator_address: Uint8Array; - timestamp: Date | undefined; - signature: Uint8Array; -} - -export interface Proposal { - type: SignedMsgType; - height: number; - round: number; - pol_round: number; - block_id: BlockID | undefined; - timestamp: Date | undefined; - signature: Uint8Array; -} - -export interface SignedHeader { - header: Header | undefined; - commit: Commit | undefined; -} - -export interface LightBlock { - signed_header: SignedHeader | undefined; - validator_set: ValidatorSet | undefined; -} - -export interface BlockMeta { - block_id: BlockID | undefined; - block_size: number; - header: Header | undefined; - num_txs: number; -} - -/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ -export interface TxProof { - root_hash: Uint8Array; - data: Uint8Array; - proof: Proof | undefined; -} - -const basePartSetHeader: object = { total: 0 }; - -export const PartSetHeader = { - encode(message: PartSetHeader, writer: Writer = Writer.create()): Writer { - if (message.total !== 0) { - writer.uint32(8).uint32(message.total); - } - if (message.hash.length !== 0) { - writer.uint32(18).bytes(message.hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PartSetHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePartSetHeader } as PartSetHeader; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = reader.uint32(); - break; - case 2: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; - }, - - toJSON(message: PartSetHeader): unknown { - const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - return message; - }, -}; - -const basePart: object = { index: 0 }; - -export const Part = { - encode(message: Part, writer: Writer = Writer.create()): Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - if (message.bytes.length !== 0) { - writer.uint32(18).bytes(message.bytes); - } - if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Part { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePart } as Part; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.bytes = reader.bytes(); - break; - case 3: - message.proof = Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = bytesFromBase64(object.bytes); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; - }, - - toJSON(message: Part): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.bytes !== undefined && - (obj.bytes = base64FromBytes( - message.bytes !== undefined ? message.bytes : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = object.bytes; - } else { - message.bytes = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } - return message; - }, -}; - -const baseBlockID: object = {}; - -export const BlockID = { - encode(message: BlockID, writer: Writer = Writer.create()): Writer { - if (message.hash.length !== 0) { - writer.uint32(10).bytes(message.hash); - } - if (message.part_set_header !== undefined) { - PartSetHeader.encode( - message.part_set_header, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BlockID { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockID } as BlockID; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - case 2: - message.part_set_header = PartSetHeader.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromJSON(object.part_set_header); - } else { - message.part_set_header = undefined; - } - return message; - }, - - toJSON(message: BlockID): unknown { - const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.part_set_header !== undefined && - (obj.part_set_header = message.part_set_header - ? PartSetHeader.toJSON(message.part_set_header) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromPartial( - object.part_set_header - ); - } else { - message.part_set_header = undefined; - } - return message; - }, -}; - -const baseHeader: object = { chain_id: "", height: 0 }; - -export const Header = { - encode(message: Header, writer: Writer = Writer.create()): Writer { - if (message.version !== undefined) { - Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); - } - if (message.chain_id !== "") { - writer.uint32(18).string(message.chain_id); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(34).fork() - ).ldelim(); - } - if (message.last_block_id !== undefined) { - BlockID.encode(message.last_block_id, writer.uint32(42).fork()).ldelim(); - } - if (message.last_commit_hash.length !== 0) { - writer.uint32(50).bytes(message.last_commit_hash); - } - if (message.data_hash.length !== 0) { - writer.uint32(58).bytes(message.data_hash); - } - if (message.validators_hash.length !== 0) { - writer.uint32(66).bytes(message.validators_hash); - } - if (message.next_validators_hash.length !== 0) { - writer.uint32(74).bytes(message.next_validators_hash); - } - if (message.consensus_hash.length !== 0) { - writer.uint32(82).bytes(message.consensus_hash); - } - if (message.app_hash.length !== 0) { - writer.uint32(90).bytes(message.app_hash); - } - if (message.last_results_hash.length !== 0) { - writer.uint32(98).bytes(message.last_results_hash); - } - if (message.evidence_hash.length !== 0) { - writer.uint32(106).bytes(message.evidence_hash); - } - if (message.proposer_address.length !== 0) { - writer.uint32(114).bytes(message.proposer_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Header { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeader } as Header; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = Consensus.decode(reader, reader.uint32()); - break; - case 2: - message.chain_id = reader.string(); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 5: - message.last_block_id = BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.last_commit_hash = reader.bytes(); - break; - case 7: - message.data_hash = reader.bytes(); - break; - case 8: - message.validators_hash = reader.bytes(); - break; - case 9: - message.next_validators_hash = reader.bytes(); - break; - case 10: - message.consensus_hash = reader.bytes(); - break; - case 11: - message.app_hash = reader.bytes(); - break; - case 12: - message.last_results_hash = reader.bytes(); - break; - case 13: - message.evidence_hash = reader.bytes(); - break; - case 14: - message.proposer_address = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromJSON(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromJSON(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = bytesFromBase64(object.last_commit_hash); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = bytesFromBase64(object.data_hash); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = bytesFromBase64(object.validators_hash); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = bytesFromBase64( - object.next_validators_hash - ); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = bytesFromBase64(object.consensus_hash); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = bytesFromBase64(object.last_results_hash); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = bytesFromBase64(object.evidence_hash); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = bytesFromBase64(object.proposer_address); - } - return message; - }, - - toJSON(message: Header): unknown { - const obj: any = {}; - message.version !== undefined && - (obj.version = message.version - ? Consensus.toJSON(message.version) - : undefined); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.last_block_id !== undefined && - (obj.last_block_id = message.last_block_id - ? BlockID.toJSON(message.last_block_id) - : undefined); - message.last_commit_hash !== undefined && - (obj.last_commit_hash = base64FromBytes( - message.last_commit_hash !== undefined - ? message.last_commit_hash - : new Uint8Array() - )); - message.data_hash !== undefined && - (obj.data_hash = base64FromBytes( - message.data_hash !== undefined ? message.data_hash : new Uint8Array() - )); - message.validators_hash !== undefined && - (obj.validators_hash = base64FromBytes( - message.validators_hash !== undefined - ? message.validators_hash - : new Uint8Array() - )); - message.next_validators_hash !== undefined && - (obj.next_validators_hash = base64FromBytes( - message.next_validators_hash !== undefined - ? message.next_validators_hash - : new Uint8Array() - )); - message.consensus_hash !== undefined && - (obj.consensus_hash = base64FromBytes( - message.consensus_hash !== undefined - ? message.consensus_hash - : new Uint8Array() - )); - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() - )); - message.last_results_hash !== undefined && - (obj.last_results_hash = base64FromBytes( - message.last_results_hash !== undefined - ? message.last_results_hash - : new Uint8Array() - )); - message.evidence_hash !== undefined && - (obj.evidence_hash = base64FromBytes( - message.evidence_hash !== undefined - ? message.evidence_hash - : new Uint8Array() - )); - message.proposer_address !== undefined && - (obj.proposer_address = base64FromBytes( - message.proposer_address !== undefined - ? message.proposer_address - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial
): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromPartial(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromPartial(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = object.last_commit_hash; - } else { - message.last_commit_hash = new Uint8Array(); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = object.data_hash; - } else { - message.data_hash = new Uint8Array(); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = object.validators_hash; - } else { - message.validators_hash = new Uint8Array(); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = object.next_validators_hash; - } else { - message.next_validators_hash = new Uint8Array(); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = object.consensus_hash; - } else { - message.consensus_hash = new Uint8Array(); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = object.last_results_hash; - } else { - message.last_results_hash = new Uint8Array(); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = object.evidence_hash; - } else { - message.evidence_hash = new Uint8Array(); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = object.proposer_address; - } else { - message.proposer_address = new Uint8Array(); - } - return message; - }, -}; - -const baseData: object = {}; - -export const Data = { - encode(message: Data, writer: Writer = Writer.create()): Writer { - for (const v of message.txs) { - writer.uint32(10).bytes(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Data { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseData } as Data; - message.txs = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.txs.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(bytesFromBase64(e)); - } - } - return message; - }, - - toJSON(message: Data): unknown { - const obj: any = {}; - if (message.txs) { - obj.txs = message.txs.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.txs = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(e); - } - } - return message; - }, -}; - -const baseVote: object = { type: 0, height: 0, round: 0, validator_index: 0 }; - -export const Vote = { - encode(message: Vote, writer: Writer = Writer.create()): Writer { - if (message.type !== 0) { - writer.uint32(8).int32(message.type); - } - if (message.height !== 0) { - writer.uint32(16).int64(message.height); - } - if (message.round !== 0) { - writer.uint32(24).int32(message.round); - } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(34).fork()).ldelim(); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); - } - if (message.validator_address.length !== 0) { - writer.uint32(50).bytes(message.validator_address); - } - if (message.validator_index !== 0) { - writer.uint32(56).int32(message.validator_index); - } - if (message.signature.length !== 0) { - writer.uint32(66).bytes(message.signature); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVote } as Vote; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32() as any; - break; - case 2: - message.height = longToNumber(reader.int64() as Long); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 6: - message.validator_address = reader.bytes(); - break; - case 7: - message.validator_index = reader.int32(); - break; - case 8: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = Number(object.validator_index); - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: Vote): unknown { - const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.validator_index !== undefined && - (obj.validator_index = message.validator_index); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = object.validator_index; - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseCommit: object = { height: 0, round: 0 }; - -export const Commit = { - encode(message: Commit, writer: Writer = Writer.create()): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - if (message.round !== 0) { - writer.uint32(16).int32(message.round); - } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.signatures) { - CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Commit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommit } as Commit; - message.signatures = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - case 2: - message.round = reader.int32(); - break; - case 3: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 4: - message.signatures.push(CommitSig.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Commit): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? CommitSig.toJSON(e) : undefined - ); - } else { - obj.signatures = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCommitSig: object = { block_id_flag: 0 }; - -export const CommitSig = { - encode(message: CommitSig, writer: Writer = Writer.create()): Writer { - if (message.block_id_flag !== 0) { - writer.uint32(8).int32(message.block_id_flag); - } - if (message.validator_address.length !== 0) { - writer.uint32(18).bytes(message.validator_address); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(26).fork() - ).ldelim(); - } - if (message.signature.length !== 0) { - writer.uint32(34).bytes(message.signature); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CommitSig { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommitSig } as CommitSig; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id_flag = reader.int32() as any; - break; - case 2: - message.validator_address = reader.bytes(); - break; - case 3: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 4: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = blockIDFlagFromJSON(object.block_id_flag); - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: CommitSig): unknown { - const obj: any = {}; - message.block_id_flag !== undefined && - (obj.block_id_flag = blockIDFlagToJSON(message.block_id_flag)); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = object.block_id_flag; - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseProposal: object = { type: 0, height: 0, round: 0, pol_round: 0 }; - -export const Proposal = { - encode(message: Proposal, writer: Writer = Writer.create()): Writer { - if (message.type !== 0) { - writer.uint32(8).int32(message.type); - } - if (message.height !== 0) { - writer.uint32(16).int64(message.height); - } - if (message.round !== 0) { - writer.uint32(24).int32(message.round); - } - if (message.pol_round !== 0) { - writer.uint32(32).int32(message.pol_round); - } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(42).fork()).ldelim(); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(50).fork() - ).ldelim(); - } - if (message.signature.length !== 0) { - writer.uint32(58).bytes(message.signature); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProposal } as Proposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32() as any; - break; - case 2: - message.height = longToNumber(reader.int64() as Long); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.pol_round = reader.int32(); - break; - case 5: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 7: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = Number(object.pol_round); - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: Proposal): unknown { - const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.pol_round !== undefined && (obj.pol_round = message.pol_round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = object.pol_round; - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseSignedHeader: object = {}; - -export const SignedHeader = { - encode(message: SignedHeader, writer: Writer = Writer.create()): Writer { - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(10).fork()).ldelim(); - } - if (message.commit !== undefined) { - Commit.encode(message.commit, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SignedHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignedHeader } as SignedHeader; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = Header.decode(reader, reader.uint32()); - break; - case 2: - message.commit = Commit.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - return message; - }, - - toJSON(message: SignedHeader): unknown { - const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.commit !== undefined && - (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromPartial(object.commit); - } else { - message.commit = undefined; - } - return message; - }, -}; - -const baseLightBlock: object = {}; - -export const LightBlock = { - encode(message: LightBlock, writer: Writer = Writer.create()): Writer { - if (message.signed_header !== undefined) { - SignedHeader.encode( - message.signed_header, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.validator_set !== undefined) { - ValidatorSet.encode( - message.validator_set, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): LightBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLightBlock } as LightBlock; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signed_header = SignedHeader.decode(reader, reader.uint32()); - break; - case 2: - message.validator_set = ValidatorSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromJSON(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromJSON(object.validator_set); - } else { - message.validator_set = undefined; - } - return message; - }, - - toJSON(message: LightBlock): unknown { - const obj: any = {}; - message.signed_header !== undefined && - (obj.signed_header = message.signed_header - ? SignedHeader.toJSON(message.signed_header) - : undefined); - message.validator_set !== undefined && - (obj.validator_set = message.validator_set - ? ValidatorSet.toJSON(message.validator_set) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromPartial(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromPartial(object.validator_set); - } else { - message.validator_set = undefined; - } - return message; - }, -}; - -const baseBlockMeta: object = { block_size: 0, num_txs: 0 }; - -export const BlockMeta = { - encode(message: BlockMeta, writer: Writer = Writer.create()): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); - } - if (message.block_size !== 0) { - writer.uint32(16).int64(message.block_size); - } - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(26).fork()).ldelim(); - } - if (message.num_txs !== 0) { - writer.uint32(32).int64(message.num_txs); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BlockMeta { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockMeta } as BlockMeta; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 2: - message.block_size = longToNumber(reader.int64() as Long); - break; - case 3: - message.header = Header.decode(reader, reader.uint32()); - break; - case 4: - message.num_txs = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = Number(object.block_size); - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = Number(object.num_txs); - } else { - message.num_txs = 0; - } - return message; - }, - - toJSON(message: BlockMeta): unknown { - const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block_size !== undefined && (obj.block_size = message.block_size); - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.num_txs !== undefined && (obj.num_txs = message.num_txs); - return obj; - }, - - fromPartial(object: DeepPartial): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = object.block_size; - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = object.num_txs; - } else { - message.num_txs = 0; - } - return message; - }, -}; - -const baseTxProof: object = {}; - -export const TxProof = { - encode(message: TxProof, writer: Writer = Writer.create()): Writer { - if (message.root_hash.length !== 0) { - writer.uint32(10).bytes(message.root_hash); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TxProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxProof } as TxProof; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.root_hash = reader.bytes(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.proof = Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = bytesFromBase64(object.root_hash); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; - }, - - toJSON(message: TxProof): unknown { - const obj: any = {}; - message.root_hash !== undefined && - (obj.root_hash = base64FromBytes( - message.root_hash !== undefined ? message.root_hash : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = object.root_hash; - } else { - message.root_hash = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/validator.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/validator.ts deleted file mode 100644 index 8c3581c1..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/types/validator.ts +++ /dev/null @@ -1,382 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { PublicKey } from "../../tendermint/crypto/keys"; - -export const protobufPackage = "tendermint.types"; - -export interface ValidatorSet { - validators: Validator[]; - proposer: Validator | undefined; - total_voting_power: number; -} - -export interface Validator { - address: Uint8Array; - pub_key: PublicKey | undefined; - voting_power: number; - proposer_priority: number; -} - -export interface SimpleValidator { - pub_key: PublicKey | undefined; - voting_power: number; -} - -const baseValidatorSet: object = { total_voting_power: 0 }; - -export const ValidatorSet = { - encode(message: ValidatorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.validators) { - Validator.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.proposer !== undefined) { - Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); - } - if (message.total_voting_power !== 0) { - writer.uint32(24).int64(message.total_voting_power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; - case 2: - message.proposer = Validator.decode(reader, reader.uint32()); - break; - case 3: - message.total_voting_power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromJSON(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - return message; - }, - - toJSON(message: ValidatorSet): unknown { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.proposer !== undefined && - (obj.proposer = message.proposer - ? Validator.toJSON(message.proposer) - : undefined); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - return obj; - }, - - fromPartial(object: DeepPartial): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromPartial(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - return message; - }, -}; - -const baseValidator: object = { voting_power: 0, proposer_priority: 0 }; - -export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { - if (message.address.length !== 0) { - writer.uint32(10).bytes(message.address); - } - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); - } - if (message.voting_power !== 0) { - writer.uint32(24).int64(message.voting_power); - } - if (message.proposer_priority !== 0) { - writer.uint32(32).int64(message.proposer_priority); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.bytes(); - break; - case 2: - message.pub_key = PublicKey.decode(reader, reader.uint32()); - break; - case 3: - message.voting_power = longToNumber(reader.int64() as Long); - break; - case 4: - message.proposer_priority = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = Number(object.proposer_priority); - } else { - message.proposer_priority = 0; - } - return message; - }, - - toJSON(message: Validator): unknown { - const obj: any = {}; - message.address !== undefined && - (obj.address = base64FromBytes( - message.address !== undefined ? message.address : new Uint8Array() - )); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - message.proposer_priority !== undefined && - (obj.proposer_priority = message.proposer_priority); - return obj; - }, - - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = new Uint8Array(); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = object.proposer_priority; - } else { - message.proposer_priority = 0; - } - return message; - }, -}; - -const baseSimpleValidator: object = { voting_power: 0 }; - -export const SimpleValidator = { - encode(message: SimpleValidator, writer: Writer = Writer.create()): Writer { - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(10).fork()).ldelim(); - } - if (message.voting_power !== 0) { - writer.uint32(16).int64(message.voting_power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SimpleValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimpleValidator } as SimpleValidator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pub_key = PublicKey.decode(reader, reader.uint32()); - break; - case 2: - message.voting_power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - return message; - }, - - toJSON(message: SimpleValidator): unknown { - const obj: any = {}; - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - return obj; - }, - - fromPartial(object: DeepPartial): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/version/types.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/version/types.ts deleted file mode 100644 index 4bc6ad82..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/module/types/tendermint/version/types.ts +++ /dev/null @@ -1,202 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.version"; - -/** - * App includes the protocol and software version for the application. - * This information is included in ResponseInfo. The App.Protocol can be - * updated in ResponseEndBlock. - */ -export interface App { - protocol: number; - software: string; -} - -/** - * Consensus captures the consensus rules for processing a block in the blockchain, - * including all blockchain data structures and the rules of the application's - * state transition machine. - */ -export interface Consensus { - block: number; - app: number; -} - -const baseApp: object = { protocol: 0, software: "" }; - -export const App = { - encode(message: App, writer: Writer = Writer.create()): Writer { - if (message.protocol !== 0) { - writer.uint32(8).uint64(message.protocol); - } - if (message.software !== "") { - writer.uint32(18).string(message.software); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): App { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseApp } as App; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.protocol = longToNumber(reader.uint64() as Long); - break; - case 2: - message.software = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = Number(object.protocol); - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = String(object.software); - } else { - message.software = ""; - } - return message; - }, - - toJSON(message: App): unknown { - const obj: any = {}; - message.protocol !== undefined && (obj.protocol = message.protocol); - message.software !== undefined && (obj.software = message.software); - return obj; - }, - - fromPartial(object: DeepPartial): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = object.protocol; - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = object.software; - } else { - message.software = ""; - } - return message; - }, -}; - -const baseConsensus: object = { block: 0, app: 0 }; - -export const Consensus = { - encode(message: Consensus, writer: Writer = Writer.create()): Writer { - if (message.block !== 0) { - writer.uint32(8).uint64(message.block); - } - if (message.app !== 0) { - writer.uint32(16).uint64(message.app); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Consensus { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensus } as Consensus; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = longToNumber(reader.uint64() as Long); - break; - case 2: - message.app = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = Number(object.block); - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = Number(object.app); - } else { - message.app = 0; - } - return message; - }, - - toJSON(message: Consensus): unknown { - const obj: any = {}; - message.block !== undefined && (obj.block = message.block); - message.app !== undefined && (obj.app = message.app); - return obj; - }, - - fromPartial(object: DeepPartial): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = object.block; - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = object.app; - } else { - message.app = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/package.json deleted file mode 100644 index 87e59ce9..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-base-tendermint-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.base.tendermint.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/client/grpc/tmservice", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/index.ts deleted file mode 100644 index 058356b7..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/index.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - - - -export { }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - - _Structure: { - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.crisis.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - async sendMsgVerifyInvariant({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgVerifyInvariant(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVerifyInvariant:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVerifyInvariant:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgVerifyInvariant({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgVerifyInvariant(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVerifyInvariant:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVerifyInvariant:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/index.ts deleted file mode 100644 index 1e4294a4..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgVerifyInvariant } from "./types/cosmos/crisis/v1beta1/tx"; - - -const types = [ - ["/cosmos.crisis.v1beta1.MsgVerifyInvariant", MsgVerifyInvariant], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgVerifyInvariant: (data: MsgVerifyInvariant): EncodeObject => ({ typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", value: MsgVerifyInvariant.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/rest.ts deleted file mode 100644 index 6f35bbff..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/rest.ts +++ /dev/null @@ -1,223 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface ProtobufAny { - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** - * MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. - */ -export type V1Beta1MsgVerifyInvariantResponse = object; - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/crisis/v1beta1/genesis.proto - * @version version not set - */ -export class Api extends HttpClient {} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ce2ac984..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - 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 { - denom: string; - amount: string; -} - -/** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProto { - int: string; -} - -/** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProto { - dec: string; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - 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 { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - 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): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { - if (message.int !== "") { - writer.uint32(10).string(message.int); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - 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 { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { - if (message.dec !== "") { - writer.uint32(10).string(message.dec); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - 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 { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/cosmos/crisis/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/cosmos/crisis/v1beta1/genesis.ts deleted file mode 100644 index 0df431ee..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/cosmos/crisis/v1beta1/genesis.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.crisis.v1beta1"; - -/** GenesisState defines the crisis module's genesis state. */ -export interface GenesisState { - /** - * constant_fee is the fee used to verify the invariant in the crisis - * module. - */ - constant_fee: Coin | undefined; -} - -const baseGenesisState: object = {}; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.constant_fee !== undefined) { - Coin.encode(message.constant_fee, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.constant_fee = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - if (object.constant_fee !== undefined && object.constant_fee !== null) { - message.constant_fee = Coin.fromJSON(object.constant_fee); - } else { - message.constant_fee = undefined; - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.constant_fee !== undefined && - (obj.constant_fee = message.constant_fee - ? Coin.toJSON(message.constant_fee) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - if (object.constant_fee !== undefined && object.constant_fee !== null) { - message.constant_fee = Coin.fromPartial(object.constant_fee); - } else { - message.constant_fee = undefined; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/cosmos/crisis/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/cosmos/crisis/v1beta1/tx.ts deleted file mode 100644 index 27012d21..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/cosmos/crisis/v1beta1/tx.ts +++ /dev/null @@ -1,223 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.crisis.v1beta1"; - -/** MsgVerifyInvariant represents a message to verify a particular invariance. */ -export interface MsgVerifyInvariant { - sender: string; - invariant_module_name: string; - invariant_route: string; -} - -/** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ -export interface MsgVerifyInvariantResponse {} - -const baseMsgVerifyInvariant: object = { - sender: "", - invariant_module_name: "", - invariant_route: "", -}; - -export const MsgVerifyInvariant = { - encode( - message: MsgVerifyInvariant, - writer: Writer = Writer.create() - ): Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.invariant_module_name !== "") { - writer.uint32(18).string(message.invariant_module_name); - } - if (message.invariant_route !== "") { - writer.uint32(26).string(message.invariant_route); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgVerifyInvariant { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.invariant_module_name = reader.string(); - break; - case 3: - message.invariant_route = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgVerifyInvariant { - const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if ( - object.invariant_module_name !== undefined && - object.invariant_module_name !== null - ) { - message.invariant_module_name = String(object.invariant_module_name); - } else { - message.invariant_module_name = ""; - } - if ( - object.invariant_route !== undefined && - object.invariant_route !== null - ) { - message.invariant_route = String(object.invariant_route); - } else { - message.invariant_route = ""; - } - return message; - }, - - toJSON(message: MsgVerifyInvariant): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.invariant_module_name !== undefined && - (obj.invariant_module_name = message.invariant_module_name); - message.invariant_route !== undefined && - (obj.invariant_route = message.invariant_route); - return obj; - }, - - fromPartial(object: DeepPartial): MsgVerifyInvariant { - const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if ( - object.invariant_module_name !== undefined && - object.invariant_module_name !== null - ) { - message.invariant_module_name = object.invariant_module_name; - } else { - message.invariant_module_name = ""; - } - if ( - object.invariant_route !== undefined && - object.invariant_route !== null - ) { - message.invariant_route = object.invariant_route; - } else { - message.invariant_route = ""; - } - return message; - }, -}; - -const baseMsgVerifyInvariantResponse: object = {}; - -export const MsgVerifyInvariantResponse = { - encode( - _: MsgVerifyInvariantResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgVerifyInvariantResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgVerifyInvariantResponse, - } as MsgVerifyInvariantResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgVerifyInvariantResponse { - const message = { - ...baseMsgVerifyInvariantResponse, - } as MsgVerifyInvariantResponse; - return message; - }, - - toJSON(_: MsgVerifyInvariantResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgVerifyInvariantResponse { - const message = { - ...baseMsgVerifyInvariantResponse, - } as MsgVerifyInvariantResponse; - return message; - }, -}; - -/** Msg defines the bank Msg service. */ -export interface Msg { - /** VerifyInvariant defines a method to verify a particular invariance. */ - VerifyInvariant( - request: MsgVerifyInvariant - ): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - VerifyInvariant( - request: MsgVerifyInvariant - ): Promise { - const data = MsgVerifyInvariant.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.crisis.v1beta1.Msg", - "VerifyInvariant", - data - ); - return promise.then((data) => - MsgVerifyInvariantResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/package.json deleted file mode 100644 index 58eb0eca..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-crisis-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.crisis.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/crisis/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.crisis.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/index.ts deleted file mode 100644 index 6e71e6fc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/index.ts +++ /dev/null @@ -1,525 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { Params } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { ValidatorHistoricalRewards } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { ValidatorCurrentRewards } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { ValidatorAccumulatedCommission } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { ValidatorOutstandingRewards } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { ValidatorSlashEvent } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { ValidatorSlashEvents } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { FeePool } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { CommunityPoolSpendProposal } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { DelegatorStartingInfo } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { DelegationDelegatorReward } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { CommunityPoolSpendProposalWithDeposit } from "./module/types/cosmos/distribution/v1beta1/distribution" -import { DelegatorWithdrawInfo } from "./module/types/cosmos/distribution/v1beta1/genesis" -import { ValidatorOutstandingRewardsRecord } from "./module/types/cosmos/distribution/v1beta1/genesis" -import { ValidatorAccumulatedCommissionRecord } from "./module/types/cosmos/distribution/v1beta1/genesis" -import { ValidatorHistoricalRewardsRecord } from "./module/types/cosmos/distribution/v1beta1/genesis" -import { ValidatorCurrentRewardsRecord } from "./module/types/cosmos/distribution/v1beta1/genesis" -import { DelegatorStartingInfoRecord } from "./module/types/cosmos/distribution/v1beta1/genesis" -import { ValidatorSlashEventRecord } from "./module/types/cosmos/distribution/v1beta1/genesis" - - -export { Params, ValidatorHistoricalRewards, ValidatorCurrentRewards, ValidatorAccumulatedCommission, ValidatorOutstandingRewards, ValidatorSlashEvent, ValidatorSlashEvents, FeePool, CommunityPoolSpendProposal, DelegatorStartingInfo, DelegationDelegatorReward, CommunityPoolSpendProposalWithDeposit, DelegatorWithdrawInfo, ValidatorOutstandingRewardsRecord, ValidatorAccumulatedCommissionRecord, ValidatorHistoricalRewardsRecord, ValidatorCurrentRewardsRecord, DelegatorStartingInfoRecord, ValidatorSlashEventRecord }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Params: {}, - ValidatorOutstandingRewards: {}, - ValidatorCommission: {}, - ValidatorSlashes: {}, - DelegationRewards: {}, - DelegationTotalRewards: {}, - DelegatorValidators: {}, - DelegatorWithdrawAddress: {}, - CommunityPool: {}, - - _Structure: { - Params: getStructure(Params.fromPartial({})), - ValidatorHistoricalRewards: getStructure(ValidatorHistoricalRewards.fromPartial({})), - ValidatorCurrentRewards: getStructure(ValidatorCurrentRewards.fromPartial({})), - ValidatorAccumulatedCommission: getStructure(ValidatorAccumulatedCommission.fromPartial({})), - ValidatorOutstandingRewards: getStructure(ValidatorOutstandingRewards.fromPartial({})), - ValidatorSlashEvent: getStructure(ValidatorSlashEvent.fromPartial({})), - ValidatorSlashEvents: getStructure(ValidatorSlashEvents.fromPartial({})), - FeePool: getStructure(FeePool.fromPartial({})), - CommunityPoolSpendProposal: getStructure(CommunityPoolSpendProposal.fromPartial({})), - DelegatorStartingInfo: getStructure(DelegatorStartingInfo.fromPartial({})), - DelegationDelegatorReward: getStructure(DelegationDelegatorReward.fromPartial({})), - CommunityPoolSpendProposalWithDeposit: getStructure(CommunityPoolSpendProposalWithDeposit.fromPartial({})), - DelegatorWithdrawInfo: getStructure(DelegatorWithdrawInfo.fromPartial({})), - ValidatorOutstandingRewardsRecord: getStructure(ValidatorOutstandingRewardsRecord.fromPartial({})), - ValidatorAccumulatedCommissionRecord: getStructure(ValidatorAccumulatedCommissionRecord.fromPartial({})), - ValidatorHistoricalRewardsRecord: getStructure(ValidatorHistoricalRewardsRecord.fromPartial({})), - ValidatorCurrentRewardsRecord: getStructure(ValidatorCurrentRewardsRecord.fromPartial({})), - DelegatorStartingInfoRecord: getStructure(DelegatorStartingInfoRecord.fromPartial({})), - ValidatorSlashEventRecord: getStructure(ValidatorSlashEventRecord.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getValidatorOutstandingRewards: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorOutstandingRewards[JSON.stringify(params)] ?? {} - }, - getValidatorCommission: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorCommission[JSON.stringify(params)] ?? {} - }, - getValidatorSlashes: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorSlashes[JSON.stringify(params)] ?? {} - }, - getDelegationRewards: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegationRewards[JSON.stringify(params)] ?? {} - }, - getDelegationTotalRewards: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegationTotalRewards[JSON.stringify(params)] ?? {} - }, - getDelegatorValidators: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorValidators[JSON.stringify(params)] ?? {} - }, - getDelegatorWithdrawAddress: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorWithdrawAddress[JSON.stringify(params)] ?? {} - }, - getCommunityPool: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.CommunityPool[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.distribution.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorOutstandingRewards({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryValidatorOutstandingRewards( key.validator_address)).data - - - commit('QUERY', { query: 'ValidatorOutstandingRewards', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorOutstandingRewards', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorOutstandingRewards']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorOutstandingRewards API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorCommission({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryValidatorCommission( key.validator_address)).data - - - commit('QUERY', { query: 'ValidatorCommission', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorCommission', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorCommission']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorCommission API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorSlashes({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryValidatorSlashes( key.validator_address, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryValidatorSlashes( key.validator_address, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ValidatorSlashes', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorSlashes', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorSlashes']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorSlashes API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegationRewards({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDelegationRewards( key.delegator_address, key.validator_address)).data - - - commit('QUERY', { query: 'DelegationRewards', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegationRewards', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegationRewards']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegationRewards API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegationTotalRewards({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDelegationTotalRewards( key.delegator_address)).data - - - commit('QUERY', { query: 'DelegationTotalRewards', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegationTotalRewards', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegationTotalRewards']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegationTotalRewards API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorValidators({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDelegatorValidators( key.delegator_address)).data - - - commit('QUERY', { query: 'DelegatorValidators', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorValidators', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorValidators']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorValidators API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorWithdrawAddress({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDelegatorWithdrawAddress( key.delegator_address)).data - - - commit('QUERY', { query: 'DelegatorWithdrawAddress', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorWithdrawAddress', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorWithdrawAddress']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorWithdrawAddress API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryCommunityPool({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryCommunityPool()).data - - - commit('QUERY', { query: 'CommunityPool', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryCommunityPool', payload: { options: { all }, params: {...key},query }}) - return getters['getCommunityPool']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryCommunityPool API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgWithdrawValidatorCommission({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgWithdrawValidatorCommission(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawValidatorCommission:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgWithdrawValidatorCommission:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgWithdrawDelegatorReward({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgWithdrawDelegatorReward(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawDelegatorReward:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgWithdrawDelegatorReward:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgSetWithdrawAddress({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSetWithdrawAddress(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSetWithdrawAddress:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSetWithdrawAddress:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgFundCommunityPool({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgFundCommunityPool(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgFundCommunityPool:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgFundCommunityPool:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgWithdrawValidatorCommission({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgWithdrawValidatorCommission(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawValidatorCommission:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgWithdrawValidatorCommission:Create Could not create message: ' + e.message) - } - } - }, - async MsgWithdrawDelegatorReward({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgWithdrawDelegatorReward(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgWithdrawDelegatorReward:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgWithdrawDelegatorReward:Create Could not create message: ' + e.message) - } - } - }, - async MsgSetWithdrawAddress({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSetWithdrawAddress(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSetWithdrawAddress:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSetWithdrawAddress:Create Could not create message: ' + e.message) - } - } - }, - async MsgFundCommunityPool({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgFundCommunityPool(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgFundCommunityPool:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgFundCommunityPool:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/index.ts deleted file mode 100644 index d6192b2c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/index.ts +++ /dev/null @@ -1,69 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx"; -import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx"; -import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx"; -import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx"; - - -const types = [ - ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], - ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], - ["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], - ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgWithdrawValidatorCommission: (data: MsgWithdrawValidatorCommission): EncodeObject => ({ typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.fromPartial( data ) }), - msgWithdrawDelegatorReward: (data: MsgWithdrawDelegatorReward): EncodeObject => ({ typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", value: MsgWithdrawDelegatorReward.fromPartial( data ) }), - msgSetWithdrawAddress: (data: MsgSetWithdrawAddress): EncodeObject => ({ typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial( data ) }), - msgFundCommunityPool: (data: MsgFundCommunityPool): EncodeObject => ({ typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/rest.ts deleted file mode 100644 index a0507ad1..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/rest.ts +++ /dev/null @@ -1,613 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface ProtobufAny { - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* 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 V1Beta1Coin { - 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 V1Beta1DecCoin { - denom?: string; - amount?: string; -} - -/** -* DelegationDelegatorReward represents the properties -of a delegator's delegation reward. -*/ -export interface V1Beta1DelegationDelegatorReward { - validator_address?: string; - reward?: V1Beta1DecCoin[]; -} - -/** - * MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. - */ -export type V1Beta1MsgFundCommunityPoolResponse = object; - -/** - * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. - */ -export type V1Beta1MsgSetWithdrawAddressResponse = object; - -/** - * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. - */ -export type V1Beta1MsgWithdrawDelegatorRewardResponse = object; - -/** - * MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. - */ -export type V1Beta1MsgWithdrawValidatorCommissionResponse = object; - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * Params defines the set of params for the distribution module. - */ -export interface V1Beta1Params { - community_tax?: string; - base_proposer_reward?: string; - bonus_proposer_reward?: string; - withdraw_addr_enabled?: boolean; -} - -/** -* QueryCommunityPoolResponse is the response type for the Query/CommunityPool -RPC method. -*/ -export interface V1Beta1QueryCommunityPoolResponse { - /** pool defines community pool's coins. */ - pool?: V1Beta1DecCoin[]; -} - -/** -* QueryDelegationRewardsResponse is the response type for the -Query/DelegationRewards RPC method. -*/ -export interface V1Beta1QueryDelegationRewardsResponse { - /** rewards defines the rewards accrued by a delegation. */ - rewards?: V1Beta1DecCoin[]; -} - -/** -* QueryDelegationTotalRewardsResponse is the response type for the -Query/DelegationTotalRewards RPC method. -*/ -export interface V1Beta1QueryDelegationTotalRewardsResponse { - /** rewards defines all the rewards accrued by a delegator. */ - rewards?: V1Beta1DelegationDelegatorReward[]; - - /** total defines the sum of all the rewards. */ - total?: V1Beta1DecCoin[]; -} - -/** -* QueryDelegatorValidatorsResponse is the response type for the -Query/DelegatorValidators RPC method. -*/ -export interface V1Beta1QueryDelegatorValidatorsResponse { - /** validators defines the validators a delegator is delegating for. */ - validators?: string[]; -} - -/** -* QueryDelegatorWithdrawAddressResponse is the response type for the -Query/DelegatorWithdrawAddress RPC method. -*/ -export interface V1Beta1QueryDelegatorWithdrawAddressResponse { - /** withdraw_address defines the delegator address to query for. */ - withdraw_address?: string; -} - -/** - * QueryParamsResponse is the response type for the Query/Params RPC method. - */ -export interface V1Beta1QueryParamsResponse { - /** params defines the parameters of the module. */ - params?: V1Beta1Params; -} - -export interface V1Beta1QueryValidatorCommissionResponse { - /** commission defines the commision the validator received. */ - commission?: V1Beta1ValidatorAccumulatedCommission; -} - -/** -* QueryValidatorOutstandingRewardsResponse is the response type for the -Query/ValidatorOutstandingRewards RPC method. -*/ -export interface V1Beta1QueryValidatorOutstandingRewardsResponse { - /** - * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards - * for a validator inexpensive to track, allows simple sanity checks. - */ - rewards?: V1Beta1ValidatorOutstandingRewards; -} - -/** -* QueryValidatorSlashesResponse is the response type for the -Query/ValidatorSlashes RPC method. -*/ -export interface V1Beta1QueryValidatorSlashesResponse { - /** slashes defines the slashes the validator received. */ - slashes?: V1Beta1ValidatorSlashEvent[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** -* ValidatorAccumulatedCommission represents accumulated commission -for a validator kept as a running counter, can be withdrawn at any time. -*/ -export interface V1Beta1ValidatorAccumulatedCommission { - commission?: V1Beta1DecCoin[]; -} - -/** -* ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards -for a validator inexpensive to track, allows simple sanity checks. -*/ -export interface V1Beta1ValidatorOutstandingRewards { - rewards?: V1Beta1DecCoin[]; -} - -/** -* ValidatorSlashEvent represents a validator slash event. -Height is implicit within the store key. -This is needed to calculate appropriate amount of staking tokens -for delegations which are withdrawn after a slash has occurred. -*/ -export interface V1Beta1ValidatorSlashEvent { - /** @format uint64 */ - validator_period?: string; - fraction?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/distribution/v1beta1/distribution.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryCommunityPool - * @summary CommunityPool queries the community pool coins. - * @request GET:/cosmos/distribution/v1beta1/community_pool - */ - queryCommunityPool = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/distribution/v1beta1/community_pool`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDelegationTotalRewards - * @summary DelegationTotalRewards queries the total rewards accrued by a each -validator. - * @request GET:/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards - */ - queryDelegationTotalRewards = (delegator_address: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/distribution/v1beta1/delegators/${delegator_address}/rewards`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDelegationRewards - * @summary DelegationRewards queries the total rewards accrued by a delegation. - * @request GET:/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address} - */ - queryDelegationRewards = (delegator_address: string, validator_address: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/distribution/v1beta1/delegators/${delegator_address}/rewards/${validator_address}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDelegatorValidators - * @summary DelegatorValidators queries the validators of a delegator. - * @request GET:/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators - */ - queryDelegatorValidators = (delegator_address: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/distribution/v1beta1/delegators/${delegator_address}/validators`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDelegatorWithdrawAddress - * @summary DelegatorWithdrawAddress queries withdraw address of a delegator. - * @request GET:/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address - */ - queryDelegatorWithdrawAddress = (delegator_address: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/distribution/v1beta1/delegators/${delegator_address}/withdraw_address`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryParams - * @summary Params queries params of the distribution module. - * @request GET:/cosmos/distribution/v1beta1/params - */ - queryParams = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/distribution/v1beta1/params`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryValidatorCommission - * @summary ValidatorCommission queries accumulated commission for a validator. - * @request GET:/cosmos/distribution/v1beta1/validators/{validator_address}/commission - */ - queryValidatorCommission = (validator_address: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/distribution/v1beta1/validators/${validator_address}/commission`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryValidatorOutstandingRewards - * @summary ValidatorOutstandingRewards queries rewards of a validator address. - * @request GET:/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards - */ - queryValidatorOutstandingRewards = (validator_address: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/distribution/v1beta1/validators/${validator_address}/outstanding_rewards`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryValidatorSlashes - * @summary ValidatorSlashes queries slash events of a validator. - * @request GET:/cosmos/distribution/v1beta1/validators/{validator_address}/slashes - */ - queryValidatorSlashes = ( - validator_address: string, - query?: { - starting_height?: string; - ending_height?: string; - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/distribution/v1beta1/validators/${validator_address}/slashes`, - method: "GET", - query: query, - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ce2ac984..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - 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 { - denom: string; - amount: string; -} - -/** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProto { - int: string; -} - -/** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProto { - dec: string; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - 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 { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - 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): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { - if (message.int !== "") { - writer.uint32(10).string(message.int); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - 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 { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { - if (message.dec !== "") { - writer.uint32(10).string(message.dec); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - 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 { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/distribution.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/distribution.ts deleted file mode 100644 index 7ed79e05..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/distribution.ts +++ /dev/null @@ -1,1355 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmos.distribution.v1beta1"; - -/** Params defines the set of params for the distribution module. */ -export interface Params { - community_tax: string; - base_proposer_reward: string; - bonus_proposer_reward: string; - withdraw_addr_enabled: boolean; -} - -/** - * ValidatorHistoricalRewards represents historical rewards for a validator. - * Height is implicit within the store key. - * Cumulative reward ratio is the sum from the zeroeth period - * until this period of rewards / tokens, per the spec. - * The reference count indicates the number of objects - * which might need to reference this historical entry at any point. - * ReferenceCount = - * number of outstanding delegations which ended the associated period (and - * might need to read that record) - * + number of slashes which ended the associated period (and might need to - * read that record) - * + one per validator for the zeroeth period, set on initialization - */ -export interface ValidatorHistoricalRewards { - cumulative_reward_ratio: DecCoin[]; - reference_count: number; -} - -/** - * ValidatorCurrentRewards represents current rewards and current - * period for a validator kept as a running counter and incremented - * each block as long as the validator's tokens remain constant. - */ -export interface ValidatorCurrentRewards { - rewards: DecCoin[]; - period: number; -} - -/** - * ValidatorAccumulatedCommission represents accumulated commission - * for a validator kept as a running counter, can be withdrawn at any time. - */ -export interface ValidatorAccumulatedCommission { - commission: DecCoin[]; -} - -/** - * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards - * for a validator inexpensive to track, allows simple sanity checks. - */ -export interface ValidatorOutstandingRewards { - rewards: DecCoin[]; -} - -/** - * ValidatorSlashEvent represents a validator slash event. - * Height is implicit within the store key. - * This is needed to calculate appropriate amount of staking tokens - * for delegations which are withdrawn after a slash has occurred. - */ -export interface ValidatorSlashEvent { - validator_period: number; - fraction: string; -} - -/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ -export interface ValidatorSlashEvents { - validator_slash_events: ValidatorSlashEvent[]; -} - -/** FeePool is the global fee pool for distribution. */ -export interface FeePool { - community_pool: DecCoin[]; -} - -/** - * CommunityPoolSpendProposal details a proposal for use of community funds, - * together with how many coins are proposed to be spent, and to which - * recipient account. - */ -export interface CommunityPoolSpendProposal { - title: string; - description: string; - recipient: string; - amount: Coin[]; -} - -/** - * DelegatorStartingInfo represents the starting info for a delegator reward - * period. It tracks the previous validator period, the delegation's amount of - * staking token, and the creation height (to check later on if any slashes have - * occurred). NOTE: Even though validators are slashed to whole staking tokens, - * the delegators within the validator may be left with less than a full token, - * thus sdk.Dec is used. - */ -export interface DelegatorStartingInfo { - previous_period: number; - stake: string; - height: number; -} - -/** - * DelegationDelegatorReward represents the properties - * of a delegator's delegation reward. - */ -export interface DelegationDelegatorReward { - validator_address: string; - reward: DecCoin[]; -} - -/** - * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal - * with a deposit - */ -export interface CommunityPoolSpendProposalWithDeposit { - title: string; - description: string; - recipient: string; - amount: string; - deposit: string; -} - -const baseParams: object = { - community_tax: "", - base_proposer_reward: "", - bonus_proposer_reward: "", - withdraw_addr_enabled: false, -}; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.community_tax !== "") { - writer.uint32(10).string(message.community_tax); - } - if (message.base_proposer_reward !== "") { - writer.uint32(18).string(message.base_proposer_reward); - } - if (message.bonus_proposer_reward !== "") { - writer.uint32(26).string(message.bonus_proposer_reward); - } - if (message.withdraw_addr_enabled === true) { - writer.uint32(32).bool(message.withdraw_addr_enabled); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.community_tax = reader.string(); - break; - case 2: - message.base_proposer_reward = reader.string(); - break; - case 3: - message.bonus_proposer_reward = reader.string(); - break; - case 4: - message.withdraw_addr_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if (object.community_tax !== undefined && object.community_tax !== null) { - message.community_tax = String(object.community_tax); - } else { - message.community_tax = ""; - } - if ( - object.base_proposer_reward !== undefined && - object.base_proposer_reward !== null - ) { - message.base_proposer_reward = String(object.base_proposer_reward); - } else { - message.base_proposer_reward = ""; - } - if ( - object.bonus_proposer_reward !== undefined && - object.bonus_proposer_reward !== null - ) { - message.bonus_proposer_reward = String(object.bonus_proposer_reward); - } else { - message.bonus_proposer_reward = ""; - } - if ( - object.withdraw_addr_enabled !== undefined && - object.withdraw_addr_enabled !== null - ) { - message.withdraw_addr_enabled = Boolean(object.withdraw_addr_enabled); - } else { - message.withdraw_addr_enabled = false; - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.community_tax !== undefined && - (obj.community_tax = message.community_tax); - message.base_proposer_reward !== undefined && - (obj.base_proposer_reward = message.base_proposer_reward); - message.bonus_proposer_reward !== undefined && - (obj.bonus_proposer_reward = message.bonus_proposer_reward); - message.withdraw_addr_enabled !== undefined && - (obj.withdraw_addr_enabled = message.withdraw_addr_enabled); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if (object.community_tax !== undefined && object.community_tax !== null) { - message.community_tax = object.community_tax; - } else { - message.community_tax = ""; - } - if ( - object.base_proposer_reward !== undefined && - object.base_proposer_reward !== null - ) { - message.base_proposer_reward = object.base_proposer_reward; - } else { - message.base_proposer_reward = ""; - } - if ( - object.bonus_proposer_reward !== undefined && - object.bonus_proposer_reward !== null - ) { - message.bonus_proposer_reward = object.bonus_proposer_reward; - } else { - message.bonus_proposer_reward = ""; - } - if ( - object.withdraw_addr_enabled !== undefined && - object.withdraw_addr_enabled !== null - ) { - message.withdraw_addr_enabled = object.withdraw_addr_enabled; - } else { - message.withdraw_addr_enabled = false; - } - return message; - }, -}; - -const baseValidatorHistoricalRewards: object = { reference_count: 0 }; - -export const ValidatorHistoricalRewards = { - encode( - message: ValidatorHistoricalRewards, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.cumulative_reward_ratio) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.reference_count !== 0) { - writer.uint32(16).uint32(message.reference_count); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorHistoricalRewards { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorHistoricalRewards, - } as ValidatorHistoricalRewards; - message.cumulative_reward_ratio = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cumulative_reward_ratio.push( - DecCoin.decode(reader, reader.uint32()) - ); - break; - case 2: - message.reference_count = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorHistoricalRewards { - const message = { - ...baseValidatorHistoricalRewards, - } as ValidatorHistoricalRewards; - message.cumulative_reward_ratio = []; - if ( - object.cumulative_reward_ratio !== undefined && - object.cumulative_reward_ratio !== null - ) { - for (const e of object.cumulative_reward_ratio) { - message.cumulative_reward_ratio.push(DecCoin.fromJSON(e)); - } - } - if ( - object.reference_count !== undefined && - object.reference_count !== null - ) { - message.reference_count = Number(object.reference_count); - } else { - message.reference_count = 0; - } - return message; - }, - - toJSON(message: ValidatorHistoricalRewards): unknown { - const obj: any = {}; - if (message.cumulative_reward_ratio) { - obj.cumulative_reward_ratio = message.cumulative_reward_ratio.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); - } else { - obj.cumulative_reward_ratio = []; - } - message.reference_count !== undefined && - (obj.reference_count = message.reference_count); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorHistoricalRewards { - const message = { - ...baseValidatorHistoricalRewards, - } as ValidatorHistoricalRewards; - message.cumulative_reward_ratio = []; - if ( - object.cumulative_reward_ratio !== undefined && - object.cumulative_reward_ratio !== null - ) { - for (const e of object.cumulative_reward_ratio) { - message.cumulative_reward_ratio.push(DecCoin.fromPartial(e)); - } - } - if ( - object.reference_count !== undefined && - object.reference_count !== null - ) { - message.reference_count = object.reference_count; - } else { - message.reference_count = 0; - } - return message; - }, -}; - -const baseValidatorCurrentRewards: object = { period: 0 }; - -export const ValidatorCurrentRewards = { - encode( - message: ValidatorCurrentRewards, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.rewards) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.period !== 0) { - writer.uint32(16).uint64(message.period); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorCurrentRewards { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorCurrentRewards, - } as ValidatorCurrentRewards; - message.rewards = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rewards.push(DecCoin.decode(reader, reader.uint32())); - break; - case 2: - message.period = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorCurrentRewards { - const message = { - ...baseValidatorCurrentRewards, - } as ValidatorCurrentRewards; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromJSON(e)); - } - } - if (object.period !== undefined && object.period !== null) { - message.period = Number(object.period); - } else { - message.period = 0; - } - return message; - }, - - toJSON(message: ValidatorCurrentRewards): unknown { - const obj: any = {}; - if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); - } else { - obj.rewards = []; - } - message.period !== undefined && (obj.period = message.period); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorCurrentRewards { - const message = { - ...baseValidatorCurrentRewards, - } as ValidatorCurrentRewards; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromPartial(e)); - } - } - if (object.period !== undefined && object.period !== null) { - message.period = object.period; - } else { - message.period = 0; - } - return message; - }, -}; - -const baseValidatorAccumulatedCommission: object = {}; - -export const ValidatorAccumulatedCommission = { - encode( - message: ValidatorAccumulatedCommission, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.commission) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorAccumulatedCommission { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorAccumulatedCommission, - } as ValidatorAccumulatedCommission; - message.commission = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.commission.push(DecCoin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorAccumulatedCommission { - const message = { - ...baseValidatorAccumulatedCommission, - } as ValidatorAccumulatedCommission; - message.commission = []; - if (object.commission !== undefined && object.commission !== null) { - for (const e of object.commission) { - message.commission.push(DecCoin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ValidatorAccumulatedCommission): unknown { - const obj: any = {}; - if (message.commission) { - obj.commission = message.commission.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); - } else { - obj.commission = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorAccumulatedCommission { - const message = { - ...baseValidatorAccumulatedCommission, - } as ValidatorAccumulatedCommission; - message.commission = []; - if (object.commission !== undefined && object.commission !== null) { - for (const e of object.commission) { - message.commission.push(DecCoin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseValidatorOutstandingRewards: object = {}; - -export const ValidatorOutstandingRewards = { - encode( - message: ValidatorOutstandingRewards, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.rewards) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorOutstandingRewards { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorOutstandingRewards, - } as ValidatorOutstandingRewards; - message.rewards = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rewards.push(DecCoin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorOutstandingRewards { - const message = { - ...baseValidatorOutstandingRewards, - } as ValidatorOutstandingRewards; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ValidatorOutstandingRewards): unknown { - const obj: any = {}; - if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); - } else { - obj.rewards = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorOutstandingRewards { - const message = { - ...baseValidatorOutstandingRewards, - } as ValidatorOutstandingRewards; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseValidatorSlashEvent: object = { validator_period: 0, fraction: "" }; - -export const ValidatorSlashEvent = { - encode( - message: ValidatorSlashEvent, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_period !== 0) { - writer.uint32(8).uint64(message.validator_period); - } - if (message.fraction !== "") { - writer.uint32(18).string(message.fraction); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorSlashEvent { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_period = longToNumber(reader.uint64() as Long); - break; - case 2: - message.fraction = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorSlashEvent { - const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent; - if ( - object.validator_period !== undefined && - object.validator_period !== null - ) { - message.validator_period = Number(object.validator_period); - } else { - message.validator_period = 0; - } - if (object.fraction !== undefined && object.fraction !== null) { - message.fraction = String(object.fraction); - } else { - message.fraction = ""; - } - return message; - }, - - toJSON(message: ValidatorSlashEvent): unknown { - const obj: any = {}; - message.validator_period !== undefined && - (obj.validator_period = message.validator_period); - message.fraction !== undefined && (obj.fraction = message.fraction); - return obj; - }, - - fromPartial(object: DeepPartial): ValidatorSlashEvent { - const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent; - if ( - object.validator_period !== undefined && - object.validator_period !== null - ) { - message.validator_period = object.validator_period; - } else { - message.validator_period = 0; - } - if (object.fraction !== undefined && object.fraction !== null) { - message.fraction = object.fraction; - } else { - message.fraction = ""; - } - return message; - }, -}; - -const baseValidatorSlashEvents: object = {}; - -export const ValidatorSlashEvents = { - encode( - message: ValidatorSlashEvents, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.validator_slash_events) { - ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorSlashEvents { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents; - message.validator_slash_events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_slash_events.push( - ValidatorSlashEvent.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorSlashEvents { - const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents; - message.validator_slash_events = []; - if ( - object.validator_slash_events !== undefined && - object.validator_slash_events !== null - ) { - for (const e of object.validator_slash_events) { - message.validator_slash_events.push(ValidatorSlashEvent.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ValidatorSlashEvents): unknown { - const obj: any = {}; - if (message.validator_slash_events) { - obj.validator_slash_events = message.validator_slash_events.map((e) => - e ? ValidatorSlashEvent.toJSON(e) : undefined - ); - } else { - obj.validator_slash_events = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ValidatorSlashEvents { - const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents; - message.validator_slash_events = []; - if ( - object.validator_slash_events !== undefined && - object.validator_slash_events !== null - ) { - for (const e of object.validator_slash_events) { - message.validator_slash_events.push(ValidatorSlashEvent.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFeePool: object = {}; - -export const FeePool = { - encode(message: FeePool, writer: Writer = Writer.create()): Writer { - for (const v of message.community_pool) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FeePool { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFeePool } as FeePool; - message.community_pool = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.community_pool.push(DecCoin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FeePool { - const message = { ...baseFeePool } as FeePool; - message.community_pool = []; - if (object.community_pool !== undefined && object.community_pool !== null) { - for (const e of object.community_pool) { - message.community_pool.push(DecCoin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FeePool): unknown { - const obj: any = {}; - if (message.community_pool) { - obj.community_pool = message.community_pool.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); - } else { - obj.community_pool = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FeePool { - const message = { ...baseFeePool } as FeePool; - message.community_pool = []; - if (object.community_pool !== undefined && object.community_pool !== null) { - for (const e of object.community_pool) { - message.community_pool.push(DecCoin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCommunityPoolSpendProposal: object = { - title: "", - description: "", - recipient: "", -}; - -export const CommunityPoolSpendProposal = { - encode( - message: CommunityPoolSpendProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.recipient !== "") { - writer.uint32(26).string(message.recipient); - } - for (const v of message.amount) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CommunityPoolSpendProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCommunityPoolSpendProposal, - } as CommunityPoolSpendProposal; - message.amount = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.recipient = reader.string(); - break; - case 4: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CommunityPoolSpendProposal { - const message = { - ...baseCommunityPoolSpendProposal, - } as CommunityPoolSpendProposal; - message.amount = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = String(object.recipient); - } else { - message.recipient = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: CommunityPoolSpendProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.recipient !== undefined && (obj.recipient = message.recipient); - if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.amount = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): CommunityPoolSpendProposal { - const message = { - ...baseCommunityPoolSpendProposal, - } as CommunityPoolSpendProposal; - message.amount = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = object.recipient; - } else { - message.recipient = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseDelegatorStartingInfo: object = { - previous_period: 0, - stake: "", - height: 0, -}; - -export const DelegatorStartingInfo = { - encode( - message: DelegatorStartingInfo, - writer: Writer = Writer.create() - ): Writer { - if (message.previous_period !== 0) { - writer.uint32(8).uint64(message.previous_period); - } - if (message.stake !== "") { - writer.uint32(18).string(message.stake); - } - if (message.height !== 0) { - writer.uint32(24).uint64(message.height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DelegatorStartingInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.previous_period = longToNumber(reader.uint64() as Long); - break; - case 2: - message.stake = reader.string(); - break; - case 3: - message.height = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DelegatorStartingInfo { - const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo; - if ( - object.previous_period !== undefined && - object.previous_period !== null - ) { - message.previous_period = Number(object.previous_period); - } else { - message.previous_period = 0; - } - if (object.stake !== undefined && object.stake !== null) { - message.stake = String(object.stake); - } else { - message.stake = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; - }, - - toJSON(message: DelegatorStartingInfo): unknown { - const obj: any = {}; - message.previous_period !== undefined && - (obj.previous_period = message.previous_period); - message.stake !== undefined && (obj.stake = message.stake); - message.height !== undefined && (obj.height = message.height); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DelegatorStartingInfo { - const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo; - if ( - object.previous_period !== undefined && - object.previous_period !== null - ) { - message.previous_period = object.previous_period; - } else { - message.previous_period = 0; - } - if (object.stake !== undefined && object.stake !== null) { - message.stake = object.stake; - } else { - message.stake = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - return message; - }, -}; - -const baseDelegationDelegatorReward: object = { validator_address: "" }; - -export const DelegationDelegatorReward = { - encode( - message: DelegationDelegatorReward, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - for (const v of message.reward) { - DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): DelegationDelegatorReward { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDelegationDelegatorReward, - } as DelegationDelegatorReward; - message.reward = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.reward.push(DecCoin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DelegationDelegatorReward { - const message = { - ...baseDelegationDelegatorReward, - } as DelegationDelegatorReward; - message.reward = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.reward !== undefined && object.reward !== null) { - for (const e of object.reward) { - message.reward.push(DecCoin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: DelegationDelegatorReward): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - if (message.reward) { - obj.reward = message.reward.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); - } else { - obj.reward = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): DelegationDelegatorReward { - const message = { - ...baseDelegationDelegatorReward, - } as DelegationDelegatorReward; - message.reward = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.reward !== undefined && object.reward !== null) { - for (const e of object.reward) { - message.reward.push(DecCoin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCommunityPoolSpendProposalWithDeposit: object = { - title: "", - description: "", - recipient: "", - amount: "", - deposit: "", -}; - -export const CommunityPoolSpendProposalWithDeposit = { - encode( - message: CommunityPoolSpendProposalWithDeposit, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.recipient !== "") { - writer.uint32(26).string(message.recipient); - } - if (message.amount !== "") { - writer.uint32(34).string(message.amount); - } - if (message.deposit !== "") { - writer.uint32(42).string(message.deposit); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CommunityPoolSpendProposalWithDeposit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCommunityPoolSpendProposalWithDeposit, - } as CommunityPoolSpendProposalWithDeposit; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.recipient = reader.string(); - break; - case 4: - message.amount = reader.string(); - break; - case 5: - message.deposit = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CommunityPoolSpendProposalWithDeposit { - const message = { - ...baseCommunityPoolSpendProposalWithDeposit, - } as CommunityPoolSpendProposalWithDeposit; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = String(object.recipient); - } else { - message.recipient = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = String(object.deposit); - } else { - message.deposit = ""; - } - return message; - }, - - toJSON(message: CommunityPoolSpendProposalWithDeposit): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.recipient !== undefined && (obj.recipient = message.recipient); - message.amount !== undefined && (obj.amount = message.amount); - message.deposit !== undefined && (obj.deposit = message.deposit); - return obj; - }, - - fromPartial( - object: DeepPartial - ): CommunityPoolSpendProposalWithDeposit { - const message = { - ...baseCommunityPoolSpendProposalWithDeposit, - } as CommunityPoolSpendProposalWithDeposit; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = object.recipient; - } else { - message.recipient = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = object.deposit; - } else { - message.deposit = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/genesis.ts deleted file mode 100644 index f8eb8741..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/genesis.ts +++ /dev/null @@ -1,1343 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; -import { - ValidatorAccumulatedCommission, - ValidatorHistoricalRewards, - ValidatorCurrentRewards, - DelegatorStartingInfo, - ValidatorSlashEvent, - Params, - FeePool, -} from "../../../cosmos/distribution/v1beta1/distribution"; - -export const protobufPackage = "cosmos.distribution.v1beta1"; - -/** - * DelegatorWithdrawInfo is the address for where distributions rewards are - * withdrawn to by default this struct is only used at genesis to feed in - * default withdraw addresses. - */ -export interface DelegatorWithdrawInfo { - /** delegator_address is the address of the delegator. */ - delegator_address: string; - /** withdraw_address is the address to withdraw the delegation rewards to. */ - withdraw_address: string; -} - -/** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ -export interface ValidatorOutstandingRewardsRecord { - /** validator_address is the address of the validator. */ - validator_address: string; - /** outstanding_rewards represents the oustanding rewards of a validator. */ - outstanding_rewards: DecCoin[]; -} - -/** - * ValidatorAccumulatedCommissionRecord is used for import / export via genesis - * json. - */ -export interface ValidatorAccumulatedCommissionRecord { - /** validator_address is the address of the validator. */ - validator_address: string; - /** accumulated is the accumulated commission of a validator. */ - accumulated: ValidatorAccumulatedCommission | undefined; -} - -/** - * ValidatorHistoricalRewardsRecord is used for import / export via genesis - * json. - */ -export interface ValidatorHistoricalRewardsRecord { - /** validator_address is the address of the validator. */ - validator_address: string; - /** period defines the period the historical rewards apply to. */ - period: number; - /** rewards defines the historical rewards of a validator. */ - rewards: ValidatorHistoricalRewards | undefined; -} - -/** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ -export interface ValidatorCurrentRewardsRecord { - /** validator_address is the address of the validator. */ - validator_address: string; - /** rewards defines the current rewards of a validator. */ - rewards: ValidatorCurrentRewards | undefined; -} - -/** DelegatorStartingInfoRecord used for import / export via genesis json. */ -export interface DelegatorStartingInfoRecord { - /** delegator_address is the address of the delegator. */ - delegator_address: string; - /** validator_address is the address of the validator. */ - validator_address: string; - /** starting_info defines the starting info of a delegator. */ - starting_info: DelegatorStartingInfo | undefined; -} - -/** ValidatorSlashEventRecord is used for import / export via genesis json. */ -export interface ValidatorSlashEventRecord { - /** validator_address is the address of the validator. */ - validator_address: string; - /** height defines the block height at which the slash event occured. */ - height: number; - /** period is the period of the slash event. */ - period: number; - /** validator_slash_event describes the slash event. */ - validator_slash_event: ValidatorSlashEvent | undefined; -} - -/** GenesisState defines the distribution module's genesis state. */ -export interface GenesisState { - /** params defines all the paramaters of the module. */ - params: Params | undefined; - /** fee_pool defines the fee pool at genesis. */ - fee_pool: FeePool | undefined; - /** fee_pool defines the delegator withdraw infos at genesis. */ - delegator_withdraw_infos: DelegatorWithdrawInfo[]; - /** fee_pool defines the previous proposer at genesis. */ - previous_proposer: string; - /** fee_pool defines the outstanding rewards of all validators at genesis. */ - outstanding_rewards: ValidatorOutstandingRewardsRecord[]; - /** fee_pool defines the accumulated commisions of all validators at genesis. */ - validator_accumulated_commissions: ValidatorAccumulatedCommissionRecord[]; - /** fee_pool defines the historical rewards of all validators at genesis. */ - validator_historical_rewards: ValidatorHistoricalRewardsRecord[]; - /** fee_pool defines the current rewards of all validators at genesis. */ - validator_current_rewards: ValidatorCurrentRewardsRecord[]; - /** fee_pool defines the delegator starting infos at genesis. */ - delegator_starting_infos: DelegatorStartingInfoRecord[]; - /** fee_pool defines the validator slash events at genesis. */ - validator_slash_events: ValidatorSlashEventRecord[]; -} - -const baseDelegatorWithdrawInfo: object = { - delegator_address: "", - withdraw_address: "", -}; - -export const DelegatorWithdrawInfo = { - encode( - message: DelegatorWithdrawInfo, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.withdraw_address !== "") { - writer.uint32(18).string(message.withdraw_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DelegatorWithdrawInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelegatorWithdrawInfo } as DelegatorWithdrawInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.withdraw_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DelegatorWithdrawInfo { - const message = { ...baseDelegatorWithdrawInfo } as DelegatorWithdrawInfo; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = String(object.withdraw_address); - } else { - message.withdraw_address = ""; - } - return message; - }, - - toJSON(message: DelegatorWithdrawInfo): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.withdraw_address !== undefined && - (obj.withdraw_address = message.withdraw_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DelegatorWithdrawInfo { - const message = { ...baseDelegatorWithdrawInfo } as DelegatorWithdrawInfo; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = object.withdraw_address; - } else { - message.withdraw_address = ""; - } - return message; - }, -}; - -const baseValidatorOutstandingRewardsRecord: object = { validator_address: "" }; - -export const ValidatorOutstandingRewardsRecord = { - encode( - message: ValidatorOutstandingRewardsRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - for (const v of message.outstanding_rewards) { - DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorOutstandingRewardsRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorOutstandingRewardsRecord, - } as ValidatorOutstandingRewardsRecord; - message.outstanding_rewards = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.outstanding_rewards.push( - DecCoin.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorOutstandingRewardsRecord { - const message = { - ...baseValidatorOutstandingRewardsRecord, - } as ValidatorOutstandingRewardsRecord; - message.outstanding_rewards = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if ( - object.outstanding_rewards !== undefined && - object.outstanding_rewards !== null - ) { - for (const e of object.outstanding_rewards) { - message.outstanding_rewards.push(DecCoin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ValidatorOutstandingRewardsRecord): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - if (message.outstanding_rewards) { - obj.outstanding_rewards = message.outstanding_rewards.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); - } else { - obj.outstanding_rewards = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorOutstandingRewardsRecord { - const message = { - ...baseValidatorOutstandingRewardsRecord, - } as ValidatorOutstandingRewardsRecord; - message.outstanding_rewards = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if ( - object.outstanding_rewards !== undefined && - object.outstanding_rewards !== null - ) { - for (const e of object.outstanding_rewards) { - message.outstanding_rewards.push(DecCoin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseValidatorAccumulatedCommissionRecord: object = { - validator_address: "", -}; - -export const ValidatorAccumulatedCommissionRecord = { - encode( - message: ValidatorAccumulatedCommissionRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - if (message.accumulated !== undefined) { - ValidatorAccumulatedCommission.encode( - message.accumulated, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorAccumulatedCommissionRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorAccumulatedCommissionRecord, - } as ValidatorAccumulatedCommissionRecord; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.accumulated = ValidatorAccumulatedCommission.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorAccumulatedCommissionRecord { - const message = { - ...baseValidatorAccumulatedCommissionRecord, - } as ValidatorAccumulatedCommissionRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.accumulated !== undefined && object.accumulated !== null) { - message.accumulated = ValidatorAccumulatedCommission.fromJSON( - object.accumulated - ); - } else { - message.accumulated = undefined; - } - return message; - }, - - toJSON(message: ValidatorAccumulatedCommissionRecord): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.accumulated !== undefined && - (obj.accumulated = message.accumulated - ? ValidatorAccumulatedCommission.toJSON(message.accumulated) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorAccumulatedCommissionRecord { - const message = { - ...baseValidatorAccumulatedCommissionRecord, - } as ValidatorAccumulatedCommissionRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.accumulated !== undefined && object.accumulated !== null) { - message.accumulated = ValidatorAccumulatedCommission.fromPartial( - object.accumulated - ); - } else { - message.accumulated = undefined; - } - return message; - }, -}; - -const baseValidatorHistoricalRewardsRecord: object = { - validator_address: "", - period: 0, -}; - -export const ValidatorHistoricalRewardsRecord = { - encode( - message: ValidatorHistoricalRewardsRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - if (message.period !== 0) { - writer.uint32(16).uint64(message.period); - } - if (message.rewards !== undefined) { - ValidatorHistoricalRewards.encode( - message.rewards, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorHistoricalRewardsRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorHistoricalRewardsRecord, - } as ValidatorHistoricalRewardsRecord; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.period = longToNumber(reader.uint64() as Long); - break; - case 3: - message.rewards = ValidatorHistoricalRewards.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorHistoricalRewardsRecord { - const message = { - ...baseValidatorHistoricalRewardsRecord, - } as ValidatorHistoricalRewardsRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.period !== undefined && object.period !== null) { - message.period = Number(object.period); - } else { - message.period = 0; - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorHistoricalRewards.fromJSON(object.rewards); - } else { - message.rewards = undefined; - } - return message; - }, - - toJSON(message: ValidatorHistoricalRewardsRecord): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.period !== undefined && (obj.period = message.period); - message.rewards !== undefined && - (obj.rewards = message.rewards - ? ValidatorHistoricalRewards.toJSON(message.rewards) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorHistoricalRewardsRecord { - const message = { - ...baseValidatorHistoricalRewardsRecord, - } as ValidatorHistoricalRewardsRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.period !== undefined && object.period !== null) { - message.period = object.period; - } else { - message.period = 0; - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorHistoricalRewards.fromPartial(object.rewards); - } else { - message.rewards = undefined; - } - return message; - }, -}; - -const baseValidatorCurrentRewardsRecord: object = { validator_address: "" }; - -export const ValidatorCurrentRewardsRecord = { - encode( - message: ValidatorCurrentRewardsRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - if (message.rewards !== undefined) { - ValidatorCurrentRewards.encode( - message.rewards, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorCurrentRewardsRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorCurrentRewardsRecord, - } as ValidatorCurrentRewardsRecord; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.rewards = ValidatorCurrentRewards.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorCurrentRewardsRecord { - const message = { - ...baseValidatorCurrentRewardsRecord, - } as ValidatorCurrentRewardsRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorCurrentRewards.fromJSON(object.rewards); - } else { - message.rewards = undefined; - } - return message; - }, - - toJSON(message: ValidatorCurrentRewardsRecord): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.rewards !== undefined && - (obj.rewards = message.rewards - ? ValidatorCurrentRewards.toJSON(message.rewards) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorCurrentRewardsRecord { - const message = { - ...baseValidatorCurrentRewardsRecord, - } as ValidatorCurrentRewardsRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorCurrentRewards.fromPartial(object.rewards); - } else { - message.rewards = undefined; - } - return message; - }, -}; - -const baseDelegatorStartingInfoRecord: object = { - delegator_address: "", - validator_address: "", -}; - -export const DelegatorStartingInfoRecord = { - encode( - message: DelegatorStartingInfoRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); - } - if (message.starting_info !== undefined) { - DelegatorStartingInfo.encode( - message.starting_info, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): DelegatorStartingInfoRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDelegatorStartingInfoRecord, - } as DelegatorStartingInfoRecord; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_address = reader.string(); - break; - case 3: - message.starting_info = DelegatorStartingInfo.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DelegatorStartingInfoRecord { - const message = { - ...baseDelegatorStartingInfoRecord, - } as DelegatorStartingInfoRecord; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.starting_info !== undefined && object.starting_info !== null) { - message.starting_info = DelegatorStartingInfo.fromJSON( - object.starting_info - ); - } else { - message.starting_info = undefined; - } - return message; - }, - - toJSON(message: DelegatorStartingInfoRecord): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.starting_info !== undefined && - (obj.starting_info = message.starting_info - ? DelegatorStartingInfo.toJSON(message.starting_info) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DelegatorStartingInfoRecord { - const message = { - ...baseDelegatorStartingInfoRecord, - } as DelegatorStartingInfoRecord; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.starting_info !== undefined && object.starting_info !== null) { - message.starting_info = DelegatorStartingInfo.fromPartial( - object.starting_info - ); - } else { - message.starting_info = undefined; - } - return message; - }, -}; - -const baseValidatorSlashEventRecord: object = { - validator_address: "", - height: 0, - period: 0, -}; - -export const ValidatorSlashEventRecord = { - encode( - message: ValidatorSlashEventRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - if (message.height !== 0) { - writer.uint32(16).uint64(message.height); - } - if (message.period !== 0) { - writer.uint32(24).uint64(message.period); - } - if (message.validator_slash_event !== undefined) { - ValidatorSlashEvent.encode( - message.validator_slash_event, - writer.uint32(34).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorSlashEventRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorSlashEventRecord, - } as ValidatorSlashEventRecord; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.height = longToNumber(reader.uint64() as Long); - break; - case 3: - message.period = longToNumber(reader.uint64() as Long); - break; - case 4: - message.validator_slash_event = ValidatorSlashEvent.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorSlashEventRecord { - const message = { - ...baseValidatorSlashEventRecord, - } as ValidatorSlashEventRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.period !== undefined && object.period !== null) { - message.period = Number(object.period); - } else { - message.period = 0; - } - if ( - object.validator_slash_event !== undefined && - object.validator_slash_event !== null - ) { - message.validator_slash_event = ValidatorSlashEvent.fromJSON( - object.validator_slash_event - ); - } else { - message.validator_slash_event = undefined; - } - return message; - }, - - toJSON(message: ValidatorSlashEventRecord): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.height !== undefined && (obj.height = message.height); - message.period !== undefined && (obj.period = message.period); - message.validator_slash_event !== undefined && - (obj.validator_slash_event = message.validator_slash_event - ? ValidatorSlashEvent.toJSON(message.validator_slash_event) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorSlashEventRecord { - const message = { - ...baseValidatorSlashEventRecord, - } as ValidatorSlashEventRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.period !== undefined && object.period !== null) { - message.period = object.period; - } else { - message.period = 0; - } - if ( - object.validator_slash_event !== undefined && - object.validator_slash_event !== null - ) { - message.validator_slash_event = ValidatorSlashEvent.fromPartial( - object.validator_slash_event - ); - } else { - message.validator_slash_event = undefined; - } - return message; - }, -}; - -const baseGenesisState: object = { previous_proposer: "" }; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - if (message.fee_pool !== undefined) { - FeePool.encode(message.fee_pool, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.delegator_withdraw_infos) { - DelegatorWithdrawInfo.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.previous_proposer !== "") { - writer.uint32(34).string(message.previous_proposer); - } - for (const v of message.outstanding_rewards) { - ValidatorOutstandingRewardsRecord.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.validator_accumulated_commissions) { - ValidatorAccumulatedCommissionRecord.encode( - v!, - writer.uint32(50).fork() - ).ldelim(); - } - for (const v of message.validator_historical_rewards) { - ValidatorHistoricalRewardsRecord.encode( - v!, - writer.uint32(58).fork() - ).ldelim(); - } - for (const v of message.validator_current_rewards) { - ValidatorCurrentRewardsRecord.encode( - v!, - writer.uint32(66).fork() - ).ldelim(); - } - for (const v of message.delegator_starting_infos) { - DelegatorStartingInfoRecord.encode(v!, writer.uint32(74).fork()).ldelim(); - } - for (const v of message.validator_slash_events) { - ValidatorSlashEventRecord.encode(v!, writer.uint32(82).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.delegator_withdraw_infos = []; - message.outstanding_rewards = []; - message.validator_accumulated_commissions = []; - message.validator_historical_rewards = []; - message.validator_current_rewards = []; - message.delegator_starting_infos = []; - message.validator_slash_events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - case 2: - message.fee_pool = FeePool.decode(reader, reader.uint32()); - break; - case 3: - message.delegator_withdraw_infos.push( - DelegatorWithdrawInfo.decode(reader, reader.uint32()) - ); - break; - case 4: - message.previous_proposer = reader.string(); - break; - case 5: - message.outstanding_rewards.push( - ValidatorOutstandingRewardsRecord.decode(reader, reader.uint32()) - ); - break; - case 6: - message.validator_accumulated_commissions.push( - ValidatorAccumulatedCommissionRecord.decode(reader, reader.uint32()) - ); - break; - case 7: - message.validator_historical_rewards.push( - ValidatorHistoricalRewardsRecord.decode(reader, reader.uint32()) - ); - break; - case 8: - message.validator_current_rewards.push( - ValidatorCurrentRewardsRecord.decode(reader, reader.uint32()) - ); - break; - case 9: - message.delegator_starting_infos.push( - DelegatorStartingInfoRecord.decode(reader, reader.uint32()) - ); - break; - case 10: - message.validator_slash_events.push( - ValidatorSlashEventRecord.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.delegator_withdraw_infos = []; - message.outstanding_rewards = []; - message.validator_accumulated_commissions = []; - message.validator_historical_rewards = []; - message.validator_current_rewards = []; - message.delegator_starting_infos = []; - message.validator_slash_events = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.fee_pool !== undefined && object.fee_pool !== null) { - message.fee_pool = FeePool.fromJSON(object.fee_pool); - } else { - message.fee_pool = undefined; - } - if ( - object.delegator_withdraw_infos !== undefined && - object.delegator_withdraw_infos !== null - ) { - for (const e of object.delegator_withdraw_infos) { - message.delegator_withdraw_infos.push( - DelegatorWithdrawInfo.fromJSON(e) - ); - } - } - if ( - object.previous_proposer !== undefined && - object.previous_proposer !== null - ) { - message.previous_proposer = String(object.previous_proposer); - } else { - message.previous_proposer = ""; - } - if ( - object.outstanding_rewards !== undefined && - object.outstanding_rewards !== null - ) { - for (const e of object.outstanding_rewards) { - message.outstanding_rewards.push( - ValidatorOutstandingRewardsRecord.fromJSON(e) - ); - } - } - if ( - object.validator_accumulated_commissions !== undefined && - object.validator_accumulated_commissions !== null - ) { - for (const e of object.validator_accumulated_commissions) { - message.validator_accumulated_commissions.push( - ValidatorAccumulatedCommissionRecord.fromJSON(e) - ); - } - } - if ( - object.validator_historical_rewards !== undefined && - object.validator_historical_rewards !== null - ) { - for (const e of object.validator_historical_rewards) { - message.validator_historical_rewards.push( - ValidatorHistoricalRewardsRecord.fromJSON(e) - ); - } - } - if ( - object.validator_current_rewards !== undefined && - object.validator_current_rewards !== null - ) { - for (const e of object.validator_current_rewards) { - message.validator_current_rewards.push( - ValidatorCurrentRewardsRecord.fromJSON(e) - ); - } - } - if ( - object.delegator_starting_infos !== undefined && - object.delegator_starting_infos !== null - ) { - for (const e of object.delegator_starting_infos) { - message.delegator_starting_infos.push( - DelegatorStartingInfoRecord.fromJSON(e) - ); - } - } - if ( - object.validator_slash_events !== undefined && - object.validator_slash_events !== null - ) { - for (const e of object.validator_slash_events) { - message.validator_slash_events.push( - ValidatorSlashEventRecord.fromJSON(e) - ); - } - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - message.fee_pool !== undefined && - (obj.fee_pool = message.fee_pool - ? FeePool.toJSON(message.fee_pool) - : undefined); - if (message.delegator_withdraw_infos) { - obj.delegator_withdraw_infos = message.delegator_withdraw_infos.map((e) => - e ? DelegatorWithdrawInfo.toJSON(e) : undefined - ); - } else { - obj.delegator_withdraw_infos = []; - } - message.previous_proposer !== undefined && - (obj.previous_proposer = message.previous_proposer); - if (message.outstanding_rewards) { - obj.outstanding_rewards = message.outstanding_rewards.map((e) => - e ? ValidatorOutstandingRewardsRecord.toJSON(e) : undefined - ); - } else { - obj.outstanding_rewards = []; - } - if (message.validator_accumulated_commissions) { - obj.validator_accumulated_commissions = message.validator_accumulated_commissions.map( - (e) => (e ? ValidatorAccumulatedCommissionRecord.toJSON(e) : undefined) - ); - } else { - obj.validator_accumulated_commissions = []; - } - if (message.validator_historical_rewards) { - obj.validator_historical_rewards = message.validator_historical_rewards.map( - (e) => (e ? ValidatorHistoricalRewardsRecord.toJSON(e) : undefined) - ); - } else { - obj.validator_historical_rewards = []; - } - if (message.validator_current_rewards) { - obj.validator_current_rewards = message.validator_current_rewards.map( - (e) => (e ? ValidatorCurrentRewardsRecord.toJSON(e) : undefined) - ); - } else { - obj.validator_current_rewards = []; - } - if (message.delegator_starting_infos) { - obj.delegator_starting_infos = message.delegator_starting_infos.map((e) => - e ? DelegatorStartingInfoRecord.toJSON(e) : undefined - ); - } else { - obj.delegator_starting_infos = []; - } - if (message.validator_slash_events) { - obj.validator_slash_events = message.validator_slash_events.map((e) => - e ? ValidatorSlashEventRecord.toJSON(e) : undefined - ); - } else { - obj.validator_slash_events = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.delegator_withdraw_infos = []; - message.outstanding_rewards = []; - message.validator_accumulated_commissions = []; - message.validator_historical_rewards = []; - message.validator_current_rewards = []; - message.delegator_starting_infos = []; - message.validator_slash_events = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.fee_pool !== undefined && object.fee_pool !== null) { - message.fee_pool = FeePool.fromPartial(object.fee_pool); - } else { - message.fee_pool = undefined; - } - if ( - object.delegator_withdraw_infos !== undefined && - object.delegator_withdraw_infos !== null - ) { - for (const e of object.delegator_withdraw_infos) { - message.delegator_withdraw_infos.push( - DelegatorWithdrawInfo.fromPartial(e) - ); - } - } - if ( - object.previous_proposer !== undefined && - object.previous_proposer !== null - ) { - message.previous_proposer = object.previous_proposer; - } else { - message.previous_proposer = ""; - } - if ( - object.outstanding_rewards !== undefined && - object.outstanding_rewards !== null - ) { - for (const e of object.outstanding_rewards) { - message.outstanding_rewards.push( - ValidatorOutstandingRewardsRecord.fromPartial(e) - ); - } - } - if ( - object.validator_accumulated_commissions !== undefined && - object.validator_accumulated_commissions !== null - ) { - for (const e of object.validator_accumulated_commissions) { - message.validator_accumulated_commissions.push( - ValidatorAccumulatedCommissionRecord.fromPartial(e) - ); - } - } - if ( - object.validator_historical_rewards !== undefined && - object.validator_historical_rewards !== null - ) { - for (const e of object.validator_historical_rewards) { - message.validator_historical_rewards.push( - ValidatorHistoricalRewardsRecord.fromPartial(e) - ); - } - } - if ( - object.validator_current_rewards !== undefined && - object.validator_current_rewards !== null - ) { - for (const e of object.validator_current_rewards) { - message.validator_current_rewards.push( - ValidatorCurrentRewardsRecord.fromPartial(e) - ); - } - } - if ( - object.delegator_starting_infos !== undefined && - object.delegator_starting_infos !== null - ) { - for (const e of object.delegator_starting_infos) { - message.delegator_starting_infos.push( - DelegatorStartingInfoRecord.fromPartial(e) - ); - } - } - if ( - object.validator_slash_events !== undefined && - object.validator_slash_events !== null - ) { - for (const e of object.validator_slash_events) { - message.validator_slash_events.push( - ValidatorSlashEventRecord.fromPartial(e) - ); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/query.ts deleted file mode 100644 index 9a66d130..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/query.ts +++ /dev/null @@ -1,1845 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - Params, - ValidatorOutstandingRewards, - ValidatorAccumulatedCommission, - ValidatorSlashEvent, - DelegationDelegatorReward, -} from "../../../cosmos/distribution/v1beta1/distribution"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmos.distribution.v1beta1"; - -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} - -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponse { - /** params defines the parameters of the module. */ - params: Params | undefined; -} - -/** - * QueryValidatorOutstandingRewardsRequest is the request type for the - * Query/ValidatorOutstandingRewards RPC method. - */ -export interface QueryValidatorOutstandingRewardsRequest { - /** validator_address defines the validator address to query for. */ - validator_address: string; -} - -/** - * QueryValidatorOutstandingRewardsResponse is the response type for the - * Query/ValidatorOutstandingRewards RPC method. - */ -export interface QueryValidatorOutstandingRewardsResponse { - rewards: ValidatorOutstandingRewards | undefined; -} - -/** - * QueryValidatorCommissionRequest is the request type for the - * Query/ValidatorCommission RPC method - */ -export interface QueryValidatorCommissionRequest { - /** validator_address defines the validator address to query for. */ - validator_address: string; -} - -/** - * QueryValidatorCommissionResponse is the response type for the - * Query/ValidatorCommission RPC method - */ -export interface QueryValidatorCommissionResponse { - /** commission defines the commision the validator received. */ - commission: ValidatorAccumulatedCommission | undefined; -} - -/** - * QueryValidatorSlashesRequest is the request type for the - * Query/ValidatorSlashes RPC method - */ -export interface QueryValidatorSlashesRequest { - /** validator_address defines the validator address to query for. */ - validator_address: string; - /** starting_height defines the optional starting height to query the slashes. */ - starting_height: number; - /** starting_height defines the optional ending height to query the slashes. */ - ending_height: number; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryValidatorSlashesResponse is the response type for the - * Query/ValidatorSlashes RPC method. - */ -export interface QueryValidatorSlashesResponse { - /** slashes defines the slashes the validator received. */ - slashes: ValidatorSlashEvent[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** - * QueryDelegationRewardsRequest is the request type for the - * Query/DelegationRewards RPC method. - */ -export interface QueryDelegationRewardsRequest { - /** delegator_address defines the delegator address to query for. */ - delegator_address: string; - /** validator_address defines the validator address to query for. */ - validator_address: string; -} - -/** - * QueryDelegationRewardsResponse is the response type for the - * Query/DelegationRewards RPC method. - */ -export interface QueryDelegationRewardsResponse { - /** rewards defines the rewards accrued by a delegation. */ - rewards: DecCoin[]; -} - -/** - * QueryDelegationTotalRewardsRequest is the request type for the - * Query/DelegationTotalRewards RPC method. - */ -export interface QueryDelegationTotalRewardsRequest { - /** delegator_address defines the delegator address to query for. */ - delegator_address: string; -} - -/** - * QueryDelegationTotalRewardsResponse is the response type for the - * Query/DelegationTotalRewards RPC method. - */ -export interface QueryDelegationTotalRewardsResponse { - /** rewards defines all the rewards accrued by a delegator. */ - rewards: DelegationDelegatorReward[]; - /** total defines the sum of all the rewards. */ - total: DecCoin[]; -} - -/** - * QueryDelegatorValidatorsRequest is the request type for the - * Query/DelegatorValidators RPC method. - */ -export interface QueryDelegatorValidatorsRequest { - /** delegator_address defines the delegator address to query for. */ - delegator_address: string; -} - -/** - * QueryDelegatorValidatorsResponse is the response type for the - * Query/DelegatorValidators RPC method. - */ -export interface QueryDelegatorValidatorsResponse { - /** validators defines the validators a delegator is delegating for. */ - validators: string[]; -} - -/** - * QueryDelegatorWithdrawAddressRequest is the request type for the - * Query/DelegatorWithdrawAddress RPC method. - */ -export interface QueryDelegatorWithdrawAddressRequest { - /** delegator_address defines the delegator address to query for. */ - delegator_address: string; -} - -/** - * QueryDelegatorWithdrawAddressResponse is the response type for the - * Query/DelegatorWithdrawAddress RPC method. - */ -export interface QueryDelegatorWithdrawAddressResponse { - /** withdraw_address defines the delegator address to query for. */ - withdraw_address: string; -} - -/** - * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC - * method. - */ -export interface QueryCommunityPoolRequest {} - -/** - * QueryCommunityPoolResponse is the response type for the Query/CommunityPool - * RPC method. - */ -export interface QueryCommunityPoolResponse { - /** pool defines community pool's coins. */ - pool: DecCoin[]; -} - -const baseQueryParamsRequest: object = {}; - -export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, - - toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, -}; - -const baseQueryParamsResponse: object = {}; - -export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - 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): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -const baseQueryValidatorOutstandingRewardsRequest: object = { - validator_address: "", -}; - -export const QueryValidatorOutstandingRewardsRequest = { - encode( - message: QueryValidatorOutstandingRewardsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorOutstandingRewardsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorOutstandingRewardsRequest, - } as QueryValidatorOutstandingRewardsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorOutstandingRewardsRequest { - const message = { - ...baseQueryValidatorOutstandingRewardsRequest, - } as QueryValidatorOutstandingRewardsRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; - }, - - toJSON(message: QueryValidatorOutstandingRewardsRequest): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorOutstandingRewardsRequest { - const message = { - ...baseQueryValidatorOutstandingRewardsRequest, - } as QueryValidatorOutstandingRewardsRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - return message; - }, -}; - -const baseQueryValidatorOutstandingRewardsResponse: object = {}; - -export const QueryValidatorOutstandingRewardsResponse = { - encode( - message: QueryValidatorOutstandingRewardsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.rewards !== undefined) { - ValidatorOutstandingRewards.encode( - message.rewards, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorOutstandingRewardsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorOutstandingRewardsResponse, - } as QueryValidatorOutstandingRewardsResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rewards = ValidatorOutstandingRewards.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorOutstandingRewardsResponse { - const message = { - ...baseQueryValidatorOutstandingRewardsResponse, - } as QueryValidatorOutstandingRewardsResponse; - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorOutstandingRewards.fromJSON(object.rewards); - } else { - message.rewards = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorOutstandingRewardsResponse): unknown { - const obj: any = {}; - message.rewards !== undefined && - (obj.rewards = message.rewards - ? ValidatorOutstandingRewards.toJSON(message.rewards) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorOutstandingRewardsResponse { - const message = { - ...baseQueryValidatorOutstandingRewardsResponse, - } as QueryValidatorOutstandingRewardsResponse; - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorOutstandingRewards.fromPartial(object.rewards); - } else { - message.rewards = undefined; - } - return message; - }, -}; - -const baseQueryValidatorCommissionRequest: object = { validator_address: "" }; - -export const QueryValidatorCommissionRequest = { - encode( - message: QueryValidatorCommissionRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorCommissionRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorCommissionRequest, - } as QueryValidatorCommissionRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorCommissionRequest { - const message = { - ...baseQueryValidatorCommissionRequest, - } as QueryValidatorCommissionRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; - }, - - toJSON(message: QueryValidatorCommissionRequest): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorCommissionRequest { - const message = { - ...baseQueryValidatorCommissionRequest, - } as QueryValidatorCommissionRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - return message; - }, -}; - -const baseQueryValidatorCommissionResponse: object = {}; - -export const QueryValidatorCommissionResponse = { - encode( - message: QueryValidatorCommissionResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.commission !== undefined) { - ValidatorAccumulatedCommission.encode( - message.commission, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorCommissionResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorCommissionResponse, - } as QueryValidatorCommissionResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.commission = ValidatorAccumulatedCommission.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorCommissionResponse { - const message = { - ...baseQueryValidatorCommissionResponse, - } as QueryValidatorCommissionResponse; - if (object.commission !== undefined && object.commission !== null) { - message.commission = ValidatorAccumulatedCommission.fromJSON( - object.commission - ); - } else { - message.commission = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorCommissionResponse): unknown { - const obj: any = {}; - message.commission !== undefined && - (obj.commission = message.commission - ? ValidatorAccumulatedCommission.toJSON(message.commission) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorCommissionResponse { - const message = { - ...baseQueryValidatorCommissionResponse, - } as QueryValidatorCommissionResponse; - if (object.commission !== undefined && object.commission !== null) { - message.commission = ValidatorAccumulatedCommission.fromPartial( - object.commission - ); - } else { - message.commission = undefined; - } - return message; - }, -}; - -const baseQueryValidatorSlashesRequest: object = { - validator_address: "", - starting_height: 0, - ending_height: 0, -}; - -export const QueryValidatorSlashesRequest = { - encode( - message: QueryValidatorSlashesRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - if (message.starting_height !== 0) { - writer.uint32(16).uint64(message.starting_height); - } - if (message.ending_height !== 0) { - writer.uint32(24).uint64(message.ending_height); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorSlashesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorSlashesRequest, - } as QueryValidatorSlashesRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.starting_height = longToNumber(reader.uint64() as Long); - break; - case 3: - message.ending_height = longToNumber(reader.uint64() as Long); - break; - case 4: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorSlashesRequest { - const message = { - ...baseQueryValidatorSlashesRequest, - } as QueryValidatorSlashesRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if ( - object.starting_height !== undefined && - object.starting_height !== null - ) { - message.starting_height = Number(object.starting_height); - } else { - message.starting_height = 0; - } - if (object.ending_height !== undefined && object.ending_height !== null) { - message.ending_height = Number(object.ending_height); - } else { - message.ending_height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorSlashesRequest): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.starting_height !== undefined && - (obj.starting_height = message.starting_height); - message.ending_height !== undefined && - (obj.ending_height = message.ending_height); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorSlashesRequest { - const message = { - ...baseQueryValidatorSlashesRequest, - } as QueryValidatorSlashesRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if ( - object.starting_height !== undefined && - object.starting_height !== null - ) { - message.starting_height = object.starting_height; - } else { - message.starting_height = 0; - } - if (object.ending_height !== undefined && object.ending_height !== null) { - message.ending_height = object.ending_height; - } else { - message.ending_height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryValidatorSlashesResponse: object = {}; - -export const QueryValidatorSlashesResponse = { - encode( - message: QueryValidatorSlashesResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.slashes) { - ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorSlashesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorSlashesResponse, - } as QueryValidatorSlashesResponse; - message.slashes = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.slashes.push( - ValidatorSlashEvent.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): QueryValidatorSlashesResponse { - const message = { - ...baseQueryValidatorSlashesResponse, - } as QueryValidatorSlashesResponse; - message.slashes = []; - if (object.slashes !== undefined && object.slashes !== null) { - for (const e of object.slashes) { - message.slashes.push(ValidatorSlashEvent.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorSlashesResponse): unknown { - const obj: any = {}; - if (message.slashes) { - obj.slashes = message.slashes.map((e) => - e ? ValidatorSlashEvent.toJSON(e) : undefined - ); - } else { - obj.slashes = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorSlashesResponse { - const message = { - ...baseQueryValidatorSlashesResponse, - } as QueryValidatorSlashesResponse; - message.slashes = []; - if (object.slashes !== undefined && object.slashes !== null) { - for (const e of object.slashes) { - message.slashes.push(ValidatorSlashEvent.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDelegationRewardsRequest: object = { - delegator_address: "", - validator_address: "", -}; - -export const QueryDelegationRewardsRequest = { - encode( - message: QueryDelegationRewardsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegationRewardsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationRewardsRequest, - } as QueryDelegationRewardsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegationRewardsRequest { - const message = { - ...baseQueryDelegationRewardsRequest, - } as QueryDelegationRewardsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; - }, - - toJSON(message: QueryDelegationRewardsRequest): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegationRewardsRequest { - const message = { - ...baseQueryDelegationRewardsRequest, - } as QueryDelegationRewardsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - return message; - }, -}; - -const baseQueryDelegationRewardsResponse: object = {}; - -export const QueryDelegationRewardsResponse = { - encode( - message: QueryDelegationRewardsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.rewards) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegationRewardsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationRewardsResponse, - } as QueryDelegationRewardsResponse; - message.rewards = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rewards.push(DecCoin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegationRewardsResponse { - const message = { - ...baseQueryDelegationRewardsResponse, - } as QueryDelegationRewardsResponse; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: QueryDelegationRewardsResponse): unknown { - const obj: any = {}; - if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); - } else { - obj.rewards = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegationRewardsResponse { - const message = { - ...baseQueryDelegationRewardsResponse, - } as QueryDelegationRewardsResponse; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseQueryDelegationTotalRewardsRequest: object = { - delegator_address: "", -}; - -export const QueryDelegationTotalRewardsRequest = { - encode( - message: QueryDelegationTotalRewardsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegationTotalRewardsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationTotalRewardsRequest, - } as QueryDelegationTotalRewardsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegationTotalRewardsRequest { - const message = { - ...baseQueryDelegationTotalRewardsRequest, - } as QueryDelegationTotalRewardsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - return message; - }, - - toJSON(message: QueryDelegationTotalRewardsRequest): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegationTotalRewardsRequest { - const message = { - ...baseQueryDelegationTotalRewardsRequest, - } as QueryDelegationTotalRewardsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - return message; - }, -}; - -const baseQueryDelegationTotalRewardsResponse: object = {}; - -export const QueryDelegationTotalRewardsResponse = { - encode( - message: QueryDelegationTotalRewardsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.rewards) { - DelegationDelegatorReward.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.total) { - DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegationTotalRewardsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationTotalRewardsResponse, - } as QueryDelegationTotalRewardsResponse; - message.rewards = []; - message.total = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rewards.push( - DelegationDelegatorReward.decode(reader, reader.uint32()) - ); - break; - case 2: - message.total.push(DecCoin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegationTotalRewardsResponse { - const message = { - ...baseQueryDelegationTotalRewardsResponse, - } as QueryDelegationTotalRewardsResponse; - message.rewards = []; - message.total = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DelegationDelegatorReward.fromJSON(e)); - } - } - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(DecCoin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: QueryDelegationTotalRewardsResponse): unknown { - const obj: any = {}; - if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? DelegationDelegatorReward.toJSON(e) : undefined - ); - } else { - obj.rewards = []; - } - if (message.total) { - obj.total = message.total.map((e) => (e ? DecCoin.toJSON(e) : undefined)); - } else { - obj.total = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegationTotalRewardsResponse { - const message = { - ...baseQueryDelegationTotalRewardsResponse, - } as QueryDelegationTotalRewardsResponse; - message.rewards = []; - message.total = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DelegationDelegatorReward.fromPartial(e)); - } - } - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(DecCoin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseQueryDelegatorValidatorsRequest: object = { delegator_address: "" }; - -export const QueryDelegatorValidatorsRequest = { - encode( - message: QueryDelegatorValidatorsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegatorValidatorsRequest { - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - return message; - }, - - toJSON(message: QueryDelegatorValidatorsRequest): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorValidatorsRequest { - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - return message; - }, -}; - -const baseQueryDelegatorValidatorsResponse: object = { validators: "" }; - -export const QueryDelegatorValidatorsResponse = { - encode( - message: QueryDelegatorValidatorsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.validators) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validators.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegatorValidatorsResponse { - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(String(e)); - } - } - return message; - }, - - toJSON(message: QueryDelegatorValidatorsResponse): unknown { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map((e) => e); - } else { - obj.validators = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorValidatorsResponse { - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(e); - } - } - return message; - }, -}; - -const baseQueryDelegatorWithdrawAddressRequest: object = { - delegator_address: "", -}; - -export const QueryDelegatorWithdrawAddressRequest = { - encode( - message: QueryDelegatorWithdrawAddressRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorWithdrawAddressRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorWithdrawAddressRequest, - } as QueryDelegatorWithdrawAddressRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegatorWithdrawAddressRequest { - const message = { - ...baseQueryDelegatorWithdrawAddressRequest, - } as QueryDelegatorWithdrawAddressRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - return message; - }, - - toJSON(message: QueryDelegatorWithdrawAddressRequest): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorWithdrawAddressRequest { - const message = { - ...baseQueryDelegatorWithdrawAddressRequest, - } as QueryDelegatorWithdrawAddressRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - return message; - }, -}; - -const baseQueryDelegatorWithdrawAddressResponse: object = { - withdraw_address: "", -}; - -export const QueryDelegatorWithdrawAddressResponse = { - encode( - message: QueryDelegatorWithdrawAddressResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.withdraw_address !== "") { - writer.uint32(10).string(message.withdraw_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorWithdrawAddressResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorWithdrawAddressResponse, - } as QueryDelegatorWithdrawAddressResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.withdraw_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegatorWithdrawAddressResponse { - const message = { - ...baseQueryDelegatorWithdrawAddressResponse, - } as QueryDelegatorWithdrawAddressResponse; - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = String(object.withdraw_address); - } else { - message.withdraw_address = ""; - } - return message; - }, - - toJSON(message: QueryDelegatorWithdrawAddressResponse): unknown { - const obj: any = {}; - message.withdraw_address !== undefined && - (obj.withdraw_address = message.withdraw_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorWithdrawAddressResponse { - const message = { - ...baseQueryDelegatorWithdrawAddressResponse, - } as QueryDelegatorWithdrawAddressResponse; - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = object.withdraw_address; - } else { - message.withdraw_address = ""; - } - return message; - }, -}; - -const baseQueryCommunityPoolRequest: object = {}; - -export const QueryCommunityPoolRequest = { - encode( - _: QueryCommunityPoolRequest, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryCommunityPoolRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryCommunityPoolRequest, - } as QueryCommunityPoolRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryCommunityPoolRequest { - const message = { - ...baseQueryCommunityPoolRequest, - } as QueryCommunityPoolRequest; - return message; - }, - - toJSON(_: QueryCommunityPoolRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): QueryCommunityPoolRequest { - const message = { - ...baseQueryCommunityPoolRequest, - } as QueryCommunityPoolRequest; - return message; - }, -}; - -const baseQueryCommunityPoolResponse: object = {}; - -export const QueryCommunityPoolResponse = { - encode( - message: QueryCommunityPoolResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.pool) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryCommunityPoolResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryCommunityPoolResponse, - } as QueryCommunityPoolResponse; - message.pool = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pool.push(DecCoin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryCommunityPoolResponse { - const message = { - ...baseQueryCommunityPoolResponse, - } as QueryCommunityPoolResponse; - message.pool = []; - if (object.pool !== undefined && object.pool !== null) { - for (const e of object.pool) { - message.pool.push(DecCoin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: QueryCommunityPoolResponse): unknown { - const obj: any = {}; - if (message.pool) { - obj.pool = message.pool.map((e) => (e ? DecCoin.toJSON(e) : undefined)); - } else { - obj.pool = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryCommunityPoolResponse { - const message = { - ...baseQueryCommunityPoolResponse, - } as QueryCommunityPoolResponse; - message.pool = []; - if (object.pool !== undefined && object.pool !== null) { - for (const e of object.pool) { - message.pool.push(DecCoin.fromPartial(e)); - } - } - return message; - }, -}; - -/** Query defines the gRPC querier service for distribution module. */ -export interface Query { - /** Params queries params of the distribution module. */ - Params(request: QueryParamsRequest): Promise; - /** ValidatorOutstandingRewards queries rewards of a validator address. */ - ValidatorOutstandingRewards( - request: QueryValidatorOutstandingRewardsRequest - ): Promise; - /** ValidatorCommission queries accumulated commission for a validator. */ - ValidatorCommission( - request: QueryValidatorCommissionRequest - ): Promise; - /** ValidatorSlashes queries slash events of a validator. */ - ValidatorSlashes( - request: QueryValidatorSlashesRequest - ): Promise; - /** DelegationRewards queries the total rewards accrued by a delegation. */ - DelegationRewards( - request: QueryDelegationRewardsRequest - ): Promise; - /** - * DelegationTotalRewards queries the total rewards accrued by a each - * validator. - */ - DelegationTotalRewards( - request: QueryDelegationTotalRewardsRequest - ): Promise; - /** DelegatorValidators queries the validators of a delegator. */ - DelegatorValidators( - request: QueryDelegatorValidatorsRequest - ): Promise; - /** DelegatorWithdrawAddress queries withdraw address of a delegator. */ - DelegatorWithdrawAddress( - request: QueryDelegatorWithdrawAddressRequest - ): Promise; - /** CommunityPool queries the community pool coins. */ - CommunityPool( - request: QueryCommunityPoolRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } - - ValidatorOutstandingRewards( - request: QueryValidatorOutstandingRewardsRequest - ): Promise { - const data = QueryValidatorOutstandingRewardsRequest.encode( - request - ).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "ValidatorOutstandingRewards", - data - ); - return promise.then((data) => - QueryValidatorOutstandingRewardsResponse.decode(new Reader(data)) - ); - } - - ValidatorCommission( - request: QueryValidatorCommissionRequest - ): Promise { - const data = QueryValidatorCommissionRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "ValidatorCommission", - data - ); - return promise.then((data) => - QueryValidatorCommissionResponse.decode(new Reader(data)) - ); - } - - ValidatorSlashes( - request: QueryValidatorSlashesRequest - ): Promise { - const data = QueryValidatorSlashesRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "ValidatorSlashes", - data - ); - return promise.then((data) => - QueryValidatorSlashesResponse.decode(new Reader(data)) - ); - } - - DelegationRewards( - request: QueryDelegationRewardsRequest - ): Promise { - const data = QueryDelegationRewardsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "DelegationRewards", - data - ); - return promise.then((data) => - QueryDelegationRewardsResponse.decode(new Reader(data)) - ); - } - - DelegationTotalRewards( - request: QueryDelegationTotalRewardsRequest - ): Promise { - const data = QueryDelegationTotalRewardsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "DelegationTotalRewards", - data - ); - return promise.then((data) => - QueryDelegationTotalRewardsResponse.decode(new Reader(data)) - ); - } - - DelegatorValidators( - request: QueryDelegatorValidatorsRequest - ): Promise { - const data = QueryDelegatorValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "DelegatorValidators", - data - ); - return promise.then((data) => - QueryDelegatorValidatorsResponse.decode(new Reader(data)) - ); - } - - DelegatorWithdrawAddress( - request: QueryDelegatorWithdrawAddressRequest - ): Promise { - const data = QueryDelegatorWithdrawAddressRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "DelegatorWithdrawAddress", - data - ); - return promise.then((data) => - QueryDelegatorWithdrawAddressResponse.decode(new Reader(data)) - ); - } - - CommunityPool( - request: QueryCommunityPoolRequest - ): Promise { - const data = QueryCommunityPoolRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "CommunityPool", - data - ); - return promise.then((data) => - QueryCommunityPoolResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/tx.ts deleted file mode 100644 index a983e05d..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/cosmos/distribution/v1beta1/tx.ts +++ /dev/null @@ -1,728 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmos.distribution.v1beta1"; - -/** - * MsgSetWithdrawAddress sets the withdraw address for - * a delegator (or validator self-delegation). - */ -export interface MsgSetWithdrawAddress { - delegator_address: string; - withdraw_address: string; -} - -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ -export interface MsgSetWithdrawAddressResponse {} - -/** - * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator - * from a single validator. - */ -export interface MsgWithdrawDelegatorReward { - delegator_address: string; - validator_address: string; -} - -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponse {} - -/** - * MsgWithdrawValidatorCommission withdraws the full commission to the validator - * address. - */ -export interface MsgWithdrawValidatorCommission { - validator_address: string; -} - -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponse {} - -/** - * MsgFundCommunityPool allows an account to directly - * fund the community pool. - */ -export interface MsgFundCommunityPool { - amount: Coin[]; - depositor: string; -} - -/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ -export interface MsgFundCommunityPoolResponse {} - -const baseMsgSetWithdrawAddress: object = { - delegator_address: "", - withdraw_address: "", -}; - -export const MsgSetWithdrawAddress = { - encode( - message: MsgSetWithdrawAddress, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.withdraw_address !== "") { - writer.uint32(18).string(message.withdraw_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgSetWithdrawAddress { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.withdraw_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSetWithdrawAddress { - const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = String(object.withdraw_address); - } else { - message.withdraw_address = ""; - } - return message; - }, - - toJSON(message: MsgSetWithdrawAddress): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.withdraw_address !== undefined && - (obj.withdraw_address = message.withdraw_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgSetWithdrawAddress { - const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = object.withdraw_address; - } else { - message.withdraw_address = ""; - } - return message; - }, -}; - -const baseMsgSetWithdrawAddressResponse: object = {}; - -export const MsgSetWithdrawAddressResponse = { - encode( - _: MsgSetWithdrawAddressResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgSetWithdrawAddressResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgSetWithdrawAddressResponse, - } as MsgSetWithdrawAddressResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgSetWithdrawAddressResponse { - const message = { - ...baseMsgSetWithdrawAddressResponse, - } as MsgSetWithdrawAddressResponse; - return message; - }, - - toJSON(_: MsgSetWithdrawAddressResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgSetWithdrawAddressResponse { - const message = { - ...baseMsgSetWithdrawAddressResponse, - } as MsgSetWithdrawAddressResponse; - return message; - }, -}; - -const baseMsgWithdrawDelegatorReward: object = { - delegator_address: "", - validator_address: "", -}; - -export const MsgWithdrawDelegatorReward = { - encode( - message: MsgWithdrawDelegatorReward, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgWithdrawDelegatorReward { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgWithdrawDelegatorReward, - } as MsgWithdrawDelegatorReward; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgWithdrawDelegatorReward { - const message = { - ...baseMsgWithdrawDelegatorReward, - } as MsgWithdrawDelegatorReward; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; - }, - - toJSON(message: MsgWithdrawDelegatorReward): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgWithdrawDelegatorReward { - const message = { - ...baseMsgWithdrawDelegatorReward, - } as MsgWithdrawDelegatorReward; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - return message; - }, -}; - -const baseMsgWithdrawDelegatorRewardResponse: object = {}; - -export const MsgWithdrawDelegatorRewardResponse = { - encode( - _: MsgWithdrawDelegatorRewardResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgWithdrawDelegatorRewardResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgWithdrawDelegatorRewardResponse, - } as MsgWithdrawDelegatorRewardResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgWithdrawDelegatorRewardResponse { - const message = { - ...baseMsgWithdrawDelegatorRewardResponse, - } as MsgWithdrawDelegatorRewardResponse; - return message; - }, - - toJSON(_: MsgWithdrawDelegatorRewardResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgWithdrawDelegatorRewardResponse { - const message = { - ...baseMsgWithdrawDelegatorRewardResponse, - } as MsgWithdrawDelegatorRewardResponse; - return message; - }, -}; - -const baseMsgWithdrawValidatorCommission: object = { validator_address: "" }; - -export const MsgWithdrawValidatorCommission = { - encode( - message: MsgWithdrawValidatorCommission, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgWithdrawValidatorCommission { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgWithdrawValidatorCommission, - } as MsgWithdrawValidatorCommission; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgWithdrawValidatorCommission { - const message = { - ...baseMsgWithdrawValidatorCommission, - } as MsgWithdrawValidatorCommission; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; - }, - - toJSON(message: MsgWithdrawValidatorCommission): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgWithdrawValidatorCommission { - const message = { - ...baseMsgWithdrawValidatorCommission, - } as MsgWithdrawValidatorCommission; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - return message; - }, -}; - -const baseMsgWithdrawValidatorCommissionResponse: object = {}; - -export const MsgWithdrawValidatorCommissionResponse = { - encode( - _: MsgWithdrawValidatorCommissionResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgWithdrawValidatorCommissionResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgWithdrawValidatorCommissionResponse, - } as MsgWithdrawValidatorCommissionResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgWithdrawValidatorCommissionResponse { - const message = { - ...baseMsgWithdrawValidatorCommissionResponse, - } as MsgWithdrawValidatorCommissionResponse; - return message; - }, - - toJSON(_: MsgWithdrawValidatorCommissionResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgWithdrawValidatorCommissionResponse { - const message = { - ...baseMsgWithdrawValidatorCommissionResponse, - } as MsgWithdrawValidatorCommissionResponse; - return message; - }, -}; - -const baseMsgFundCommunityPool: object = { depositor: "" }; - -export const MsgFundCommunityPool = { - encode( - message: MsgFundCommunityPool, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.amount) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.depositor !== "") { - writer.uint32(18).string(message.depositor); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgFundCommunityPool { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool; - message.amount = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; - case 2: - message.depositor = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgFundCommunityPool { - const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool; - message.amount = []; - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - return message; - }, - - toJSON(message: MsgFundCommunityPool): unknown { - const obj: any = {}; - if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.amount = []; - } - message.depositor !== undefined && (obj.depositor = message.depositor); - return obj; - }, - - fromPartial(object: DeepPartial): MsgFundCommunityPool { - const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool; - message.amount = []; - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; - } - return message; - }, -}; - -const baseMsgFundCommunityPoolResponse: object = {}; - -export const MsgFundCommunityPoolResponse = { - encode( - _: MsgFundCommunityPoolResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgFundCommunityPoolResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgFundCommunityPoolResponse, - } as MsgFundCommunityPoolResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgFundCommunityPoolResponse { - const message = { - ...baseMsgFundCommunityPoolResponse, - } as MsgFundCommunityPoolResponse; - return message; - }, - - toJSON(_: MsgFundCommunityPoolResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgFundCommunityPoolResponse { - const message = { - ...baseMsgFundCommunityPoolResponse, - } as MsgFundCommunityPoolResponse; - return message; - }, -}; - -/** Msg defines the distribution Msg service. */ -export interface Msg { - /** - * SetWithdrawAddress defines a method to change the withdraw address - * for a delegator (or validator self-delegation). - */ - SetWithdrawAddress( - request: MsgSetWithdrawAddress - ): Promise; - /** - * WithdrawDelegatorReward defines a method to withdraw rewards of delegator - * from a single validator. - */ - WithdrawDelegatorReward( - request: MsgWithdrawDelegatorReward - ): Promise; - /** - * WithdrawValidatorCommission defines a method to withdraw the - * full commission to the validator address. - */ - WithdrawValidatorCommission( - request: MsgWithdrawValidatorCommission - ): Promise; - /** - * FundCommunityPool defines a method to allow an account to directly - * fund the community pool. - */ - FundCommunityPool( - request: MsgFundCommunityPool - ): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - SetWithdrawAddress( - request: MsgSetWithdrawAddress - ): Promise { - const data = MsgSetWithdrawAddress.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Msg", - "SetWithdrawAddress", - data - ); - return promise.then((data) => - MsgSetWithdrawAddressResponse.decode(new Reader(data)) - ); - } - - WithdrawDelegatorReward( - request: MsgWithdrawDelegatorReward - ): Promise { - const data = MsgWithdrawDelegatorReward.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Msg", - "WithdrawDelegatorReward", - data - ); - return promise.then((data) => - MsgWithdrawDelegatorRewardResponse.decode(new Reader(data)) - ); - } - - WithdrawValidatorCommission( - request: MsgWithdrawValidatorCommission - ): Promise { - const data = MsgWithdrawValidatorCommission.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Msg", - "WithdrawValidatorCommission", - data - ); - return promise.then((data) => - MsgWithdrawValidatorCommissionResponse.decode(new Reader(data)) - ); - } - - FundCommunityPool( - request: MsgFundCommunityPool - ): Promise { - const data = MsgFundCommunityPool.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Msg", - "FundCommunityPool", - data - ); - return promise.then((data) => - MsgFundCommunityPoolResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/package.json deleted file mode 100644 index b0638974..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-distribution-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.distribution.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/distribution/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/index.ts deleted file mode 100644 index 08e3618f..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/index.ts +++ /dev/null @@ -1,202 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { Equivocation } from "./module/types/cosmos/evidence/v1beta1/evidence" - - -export { Equivocation }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Evidence: {}, - AllEvidence: {}, - - _Structure: { - Equivocation: getStructure(Equivocation.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getEvidence: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Evidence[JSON.stringify(params)] ?? {} - }, - getAllEvidence: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AllEvidence[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.evidence.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryEvidence({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryEvidence( key.evidence_hash)).data - - - commit('QUERY', { query: 'Evidence', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryEvidence', payload: { options: { all }, params: {...key},query }}) - return getters['getEvidence']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryEvidence API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAllEvidence({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryAllEvidence(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryAllEvidence({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AllEvidence', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllEvidence', payload: { options: { all }, params: {...key},query }}) - return getters['getAllEvidence']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllEvidence API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgSubmitEvidence({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitEvidence(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitEvidence:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitEvidence:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgSubmitEvidence({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitEvidence(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitEvidence:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitEvidence:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/index.ts deleted file mode 100644 index 7f205a18..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgSubmitEvidence } from "./types/cosmos/evidence/v1beta1/tx"; - - -const types = [ - ["/cosmos.evidence.v1beta1.MsgSubmitEvidence", MsgSubmitEvidence], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgSubmitEvidence: (data: MsgSubmitEvidence): EncodeObject => ({ typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence", value: MsgSubmitEvidence.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/rest.ts deleted file mode 100644 index 16ee77f3..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/rest.ts +++ /dev/null @@ -1,467 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** - * MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. - */ -export interface V1Beta1MsgSubmitEvidenceResponse { - /** - * hash defines the hash of the evidence. - * @format byte - */ - hash?: string; -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** -* QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC -method. -*/ -export interface V1Beta1QueryAllEvidenceResponse { - /** evidence returns all evidences. */ - evidence?: ProtobufAny[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * QueryEvidenceResponse is the response type for the Query/Evidence RPC method. - */ -export interface V1Beta1QueryEvidenceResponse { - /** evidence returns the requested evidence. */ - evidence?: ProtobufAny; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/evidence/v1beta1/evidence.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryAllEvidence - * @summary AllEvidence queries all evidence. - * @request GET:/cosmos/evidence/v1beta1/evidence - */ - queryAllEvidence = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/evidence/v1beta1/evidence`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryEvidence - * @summary Evidence queries evidence based on evidence hash. - * @request GET:/cosmos/evidence/v1beta1/evidence/{evidence_hash} - */ - queryEvidence = (evidence_hash: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/evidence/v1beta1/evidence/${evidence_hash}`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/evidence.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/evidence.ts deleted file mode 100644 index de5ff297..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/evidence.ts +++ /dev/null @@ -1,192 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.evidence.v1beta1"; - -/** - * Equivocation implements the Evidence interface and defines evidence of double - * signing misbehavior. - */ -export interface Equivocation { - height: number; - time: Date | undefined; - power: number; - consensus_address: string; -} - -const baseEquivocation: object = { height: 0, power: 0, consensus_address: "" }; - -export const Equivocation = { - encode(message: Equivocation, writer: Writer = Writer.create()): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.power !== 0) { - writer.uint32(24).int64(message.power); - } - if (message.consensus_address !== "") { - writer.uint32(34).string(message.consensus_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Equivocation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEquivocation } as Equivocation; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - case 2: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 3: - message.power = longToNumber(reader.int64() as Long); - break; - case 4: - message.consensus_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Equivocation { - const message = { ...baseEquivocation } as Equivocation; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.power !== undefined && object.power !== null) { - message.power = Number(object.power); - } else { - message.power = 0; - } - if ( - object.consensus_address !== undefined && - object.consensus_address !== null - ) { - message.consensus_address = String(object.consensus_address); - } else { - message.consensus_address = ""; - } - return message; - }, - - toJSON(message: Equivocation): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.power !== undefined && (obj.power = message.power); - message.consensus_address !== undefined && - (obj.consensus_address = message.consensus_address); - return obj; - }, - - fromPartial(object: DeepPartial): Equivocation { - const message = { ...baseEquivocation } as Equivocation; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.power !== undefined && object.power !== null) { - message.power = object.power; - } else { - message.power = 0; - } - if ( - object.consensus_address !== undefined && - object.consensus_address !== null - ) { - message.consensus_address = object.consensus_address; - } else { - message.consensus_address = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/genesis.ts deleted file mode 100644 index 2b659101..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/genesis.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* eslint-disable */ -import { Any } from "../../../google/protobuf/any"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.evidence.v1beta1"; - -/** GenesisState defines the evidence module's genesis state. */ -export interface GenesisState { - /** evidence defines all the evidence at genesis. */ - evidence: Any[]; -} - -const baseGenesisState: object = {}; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - for (const v of message.evidence) { - Any.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.evidence = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.evidence.push(Any.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Any.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.evidence) { - obj.evidence = message.evidence.map((e) => - e ? Any.toJSON(e) : undefined - ); - } else { - obj.evidence = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Any.fromPartial(e)); - } - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/query.ts deleted file mode 100644 index c29d4b55..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/query.ts +++ /dev/null @@ -1,429 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; - -export const protobufPackage = "cosmos.evidence.v1beta1"; - -/** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ -export interface QueryEvidenceRequest { - /** evidence_hash defines the hash of the requested evidence. */ - evidence_hash: Uint8Array; -} - -/** QueryEvidenceResponse is the response type for the Query/Evidence RPC method. */ -export interface QueryEvidenceResponse { - /** evidence returns the requested evidence. */ - evidence: Any | undefined; -} - -/** - * QueryEvidenceRequest is the request type for the Query/AllEvidence RPC - * method. - */ -export interface QueryAllEvidenceRequest { - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC - * method. - */ -export interface QueryAllEvidenceResponse { - /** evidence returns all evidences. */ - evidence: Any[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -const baseQueryEvidenceRequest: object = {}; - -export const QueryEvidenceRequest = { - encode( - message: QueryEvidenceRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.evidence_hash.length !== 0) { - writer.uint32(10).bytes(message.evidence_hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryEvidenceRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryEvidenceRequest } as QueryEvidenceRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.evidence_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryEvidenceRequest { - const message = { ...baseQueryEvidenceRequest } as QueryEvidenceRequest; - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = bytesFromBase64(object.evidence_hash); - } - return message; - }, - - toJSON(message: QueryEvidenceRequest): unknown { - const obj: any = {}; - message.evidence_hash !== undefined && - (obj.evidence_hash = base64FromBytes( - message.evidence_hash !== undefined - ? message.evidence_hash - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): QueryEvidenceRequest { - const message = { ...baseQueryEvidenceRequest } as QueryEvidenceRequest; - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = object.evidence_hash; - } else { - message.evidence_hash = new Uint8Array(); - } - return message; - }, -}; - -const baseQueryEvidenceResponse: object = {}; - -export const QueryEvidenceResponse = { - encode( - message: QueryEvidenceResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.evidence !== undefined) { - Any.encode(message.evidence, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryEvidenceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryEvidenceResponse } as QueryEvidenceResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.evidence = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryEvidenceResponse { - const message = { ...baseQueryEvidenceResponse } as QueryEvidenceResponse; - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = Any.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - return message; - }, - - toJSON(message: QueryEvidenceResponse): unknown { - const obj: any = {}; - message.evidence !== undefined && - (obj.evidence = message.evidence - ? Any.toJSON(message.evidence) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryEvidenceResponse { - const message = { ...baseQueryEvidenceResponse } as QueryEvidenceResponse; - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = Any.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } - return message; - }, -}; - -const baseQueryAllEvidenceRequest: object = {}; - -export const QueryAllEvidenceRequest = { - encode( - message: QueryAllEvidenceRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAllEvidenceRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllEvidenceRequest, - } as QueryAllEvidenceRequest; - 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): QueryAllEvidenceRequest { - const message = { - ...baseQueryAllEvidenceRequest, - } as QueryAllEvidenceRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllEvidenceRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllEvidenceRequest { - const message = { - ...baseQueryAllEvidenceRequest, - } as QueryAllEvidenceRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllEvidenceResponse: object = {}; - -export const QueryAllEvidenceResponse = { - encode( - message: QueryAllEvidenceResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.evidence) { - Any.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllEvidenceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllEvidenceResponse, - } as QueryAllEvidenceResponse; - message.evidence = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.evidence.push(Any.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): QueryAllEvidenceResponse { - const message = { - ...baseQueryAllEvidenceResponse, - } as QueryAllEvidenceResponse; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Any.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllEvidenceResponse): unknown { - const obj: any = {}; - if (message.evidence) { - obj.evidence = message.evidence.map((e) => - e ? Any.toJSON(e) : undefined - ); - } else { - obj.evidence = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllEvidenceResponse { - const message = { - ...baseQueryAllEvidenceResponse, - } as QueryAllEvidenceResponse; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Any.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -/** Query defines the gRPC querier service. */ -export interface Query { - /** Evidence queries evidence based on evidence hash. */ - Evidence(request: QueryEvidenceRequest): Promise; - /** AllEvidence queries all evidence. */ - AllEvidence( - request: QueryAllEvidenceRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Evidence(request: QueryEvidenceRequest): Promise { - const data = QueryEvidenceRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.evidence.v1beta1.Query", - "Evidence", - data - ); - return promise.then((data) => - QueryEvidenceResponse.decode(new Reader(data)) - ); - } - - AllEvidence( - request: QueryAllEvidenceRequest - ): Promise { - const data = QueryAllEvidenceRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.evidence.v1beta1.Query", - "AllEvidence", - data - ); - return promise.then((data) => - QueryAllEvidenceResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/tx.ts deleted file mode 100644 index 51a891b9..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos/evidence/v1beta1/tx.ts +++ /dev/null @@ -1,248 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; - -export const protobufPackage = "cosmos.evidence.v1beta1"; - -/** - * MsgSubmitEvidence represents a message that supports submitting arbitrary - * Evidence of misbehavior such as equivocation or counterfactual signing. - */ -export interface MsgSubmitEvidence { - submitter: string; - evidence: Any | undefined; -} - -/** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ -export interface MsgSubmitEvidenceResponse { - /** hash defines the hash of the evidence. */ - hash: Uint8Array; -} - -const baseMsgSubmitEvidence: object = { submitter: "" }; - -export const MsgSubmitEvidence = { - encode(message: MsgSubmitEvidence, writer: Writer = Writer.create()): Writer { - if (message.submitter !== "") { - writer.uint32(10).string(message.submitter); - } - if (message.evidence !== undefined) { - Any.encode(message.evidence, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgSubmitEvidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.submitter = reader.string(); - break; - case 2: - message.evidence = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSubmitEvidence { - const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; - if (object.submitter !== undefined && object.submitter !== null) { - message.submitter = String(object.submitter); - } else { - message.submitter = ""; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = Any.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - return message; - }, - - toJSON(message: MsgSubmitEvidence): unknown { - const obj: any = {}; - message.submitter !== undefined && (obj.submitter = message.submitter); - message.evidence !== undefined && - (obj.evidence = message.evidence - ? Any.toJSON(message.evidence) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): MsgSubmitEvidence { - const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; - if (object.submitter !== undefined && object.submitter !== null) { - message.submitter = object.submitter; - } else { - message.submitter = ""; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = Any.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } - return message; - }, -}; - -const baseMsgSubmitEvidenceResponse: object = {}; - -export const MsgSubmitEvidenceResponse = { - encode( - message: MsgSubmitEvidenceResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.hash.length !== 0) { - writer.uint32(34).bytes(message.hash); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgSubmitEvidenceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgSubmitEvidenceResponse, - } as MsgSubmitEvidenceResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 4: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSubmitEvidenceResponse { - const message = { - ...baseMsgSubmitEvidenceResponse, - } as MsgSubmitEvidenceResponse; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; - }, - - toJSON(message: MsgSubmitEvidenceResponse): unknown { - const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgSubmitEvidenceResponse { - const message = { - ...baseMsgSubmitEvidenceResponse, - } as MsgSubmitEvidenceResponse; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - return message; - }, -}; - -/** Msg defines the evidence Msg service. */ -export interface Msg { - /** - * SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or - * counterfactual signing. - */ - SubmitEvidence( - request: MsgSubmitEvidence - ): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - SubmitEvidence( - request: MsgSubmitEvidence - ): Promise { - const data = MsgSubmitEvidence.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.evidence.v1beta1.Msg", - "SubmitEvidence", - data - ); - return promise.then((data) => - MsgSubmitEvidenceResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos_proto/cosmos.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos_proto/cosmos.ts deleted file mode 100644 index 9ec67a12..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/cosmos_proto/cosmos.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "cosmos_proto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/package.json deleted file mode 100644 index a4387486..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-evidence-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.evidence.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/evidence/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.evidence.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/index.ts deleted file mode 100644 index 108b29be..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/index.ts +++ /dev/null @@ -1,236 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { BasicAllowance } from "./module/types/cosmos/feegrant/v1beta1/feegrant" -import { PeriodicAllowance } from "./module/types/cosmos/feegrant/v1beta1/feegrant" -import { AllowedMsgAllowance } from "./module/types/cosmos/feegrant/v1beta1/feegrant" -import { Grant } from "./module/types/cosmos/feegrant/v1beta1/feegrant" - - -export { BasicAllowance, PeriodicAllowance, AllowedMsgAllowance, Grant }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Allowance: {}, - Allowances: {}, - - _Structure: { - BasicAllowance: getStructure(BasicAllowance.fromPartial({})), - PeriodicAllowance: getStructure(PeriodicAllowance.fromPartial({})), - AllowedMsgAllowance: getStructure(AllowedMsgAllowance.fromPartial({})), - Grant: getStructure(Grant.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getAllowance: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Allowance[JSON.stringify(params)] ?? {} - }, - getAllowances: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Allowances[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.feegrant.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryAllowance({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryAllowance( key.granter, key.grantee)).data - - - commit('QUERY', { query: 'Allowance', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllowance', payload: { options: { all }, params: {...key},query }}) - return getters['getAllowance']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllowance API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAllowances({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryAllowances( key.grantee, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryAllowances( key.grantee, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Allowances', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllowances', payload: { options: { all }, params: {...key},query }}) - return getters['getAllowances']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllowances API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgRevokeAllowance({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevokeAllowance(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevokeAllowance:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRevokeAllowance:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgGrantAllowance({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgGrantAllowance(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgGrantAllowance:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgGrantAllowance:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgRevokeAllowance({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevokeAllowance(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevokeAllowance:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRevokeAllowance:Create Could not create message: ' + e.message) - } - } - }, - async MsgGrantAllowance({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgGrantAllowance(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgGrantAllowance:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgGrantAllowance:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/index.ts deleted file mode 100644 index 83004011..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/index.ts +++ /dev/null @@ -1,63 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgRevokeAllowance } from "./types/cosmos/feegrant/v1beta1/tx"; -import { MsgGrantAllowance } from "./types/cosmos/feegrant/v1beta1/tx"; - - -const types = [ - ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance], - ["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgRevokeAllowance: (data: MsgRevokeAllowance): EncodeObject => ({ typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", value: MsgRevokeAllowance.fromPartial( data ) }), - msgGrantAllowance: (data: MsgGrantAllowance): EncodeObject => ({ typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", value: MsgGrantAllowance.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/rest.ts deleted file mode 100644 index 954246a3..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/rest.ts +++ /dev/null @@ -1,477 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -export interface V1Beta1Grant { - /** granter is the address of the user granting an allowance of their funds. */ - granter?: string; - - /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee?: string; - - /** allowance can be any of basic and filtered fee allowance. */ - allowance?: ProtobufAny; -} - -/** - * MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. - */ -export type V1Beta1MsgGrantAllowanceResponse = object; - -/** - * MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. - */ -export type V1Beta1MsgRevokeAllowanceResponse = object; - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * QueryAllowanceResponse is the response type for the Query/Allowance RPC method. - */ -export interface V1Beta1QueryAllowanceResponse { - /** allowance is a allowance granted for grantee by granter. */ - allowance?: V1Beta1Grant; -} - -/** - * QueryAllowancesResponse is the response type for the Query/Allowances RPC method. - */ -export interface V1Beta1QueryAllowancesResponse { - /** allowances are allowance's granted for grantee by granter. */ - allowances?: V1Beta1Grant[]; - - /** pagination defines an pagination for the response. */ - pagination?: V1Beta1PageResponse; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/feegrant/v1beta1/feegrant.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryAllowance - * @summary Allowance returns fee granted to the grantee by the granter. - * @request GET:/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee} - */ - queryAllowance = (granter: string, grantee: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/feegrant/v1beta1/allowance/${granter}/${grantee}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryAllowances - * @summary Allowances returns all the grants for address. - * @request GET:/cosmos/feegrant/v1beta1/allowances/{grantee} - */ - queryAllowances = ( - grantee: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/feegrant/v1beta1/allowances/${grantee}`, - method: "GET", - query: query, - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ce2ac984..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - 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 { - denom: string; - amount: string; -} - -/** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProto { - int: string; -} - -/** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProto { - dec: string; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - 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 { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - 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): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { - if (message.int !== "") { - writer.uint32(10).string(message.int); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - 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 { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { - if (message.dec !== "") { - writer.uint32(10).string(message.dec); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - 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 { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/feegrant.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/feegrant.ts deleted file mode 100644 index 8c84ab16..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/feegrant.ts +++ /dev/null @@ -1,544 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Duration } from "../../../google/protobuf/duration"; -import { Any } from "../../../google/protobuf/any"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.feegrant.v1beta1"; - -/** Since: cosmos-sdk 0.43 */ - -/** - * BasicAllowance implements Allowance with a one-time grant of tokens - * that optionally expires. The grantee can use up to SpendLimit to cover fees. - */ -export interface BasicAllowance { - /** - * spend_limit specifies the maximum amount of tokens that can be spent - * by this allowance and will be updated as tokens are spent. If it is - * empty, there is no spend limit and any amount of coins can be spent. - */ - spend_limit: Coin[]; - /** expiration specifies an optional time when this allowance expires */ - expiration: Date | undefined; -} - -/** - * PeriodicAllowance extends Allowance to allow for both a maximum cap, - * as well as a limit per time period. - */ -export interface PeriodicAllowance { - /** basic specifies a struct of `BasicAllowance` */ - basic: BasicAllowance | undefined; - /** - * period specifies the time duration in which period_spend_limit coins can - * be spent before that allowance is reset - */ - period: Duration | undefined; - /** - * period_spend_limit specifies the maximum number of coins that can be spent - * in the period - */ - period_spend_limit: Coin[]; - /** period_can_spend is the number of coins left to be spent before the period_reset time */ - period_can_spend: Coin[]; - /** - * period_reset is the time at which this period resets and a new one begins, - * it is calculated from the start time of the first transaction after the - * last period ended - */ - period_reset: Date | undefined; -} - -/** AllowedMsgAllowance creates allowance only for specified message types. */ -export interface AllowedMsgAllowance { - /** allowance can be any of basic and filtered fee allowance. */ - allowance: Any | undefined; - /** allowed_messages are the messages for which the grantee has the access. */ - allowed_messages: string[]; -} - -/** Grant is stored in the KVStore to record a grant with full context */ -export interface Grant { - /** granter is the address of the user granting an allowance of their funds. */ - granter: string; - /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; - /** allowance can be any of basic and filtered fee allowance. */ - allowance: Any | undefined; -} - -const baseBasicAllowance: object = {}; - -export const BasicAllowance = { - encode(message: BasicAllowance, writer: Writer = Writer.create()): Writer { - for (const v of message.spend_limit) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.expiration !== undefined) { - Timestamp.encode( - toTimestamp(message.expiration), - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BasicAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBasicAllowance } as BasicAllowance; - message.spend_limit = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.spend_limit.push(Coin.decode(reader, reader.uint32())); - break; - case 2: - message.expiration = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BasicAllowance { - const message = { ...baseBasicAllowance } as BasicAllowance; - message.spend_limit = []; - if (object.spend_limit !== undefined && object.spend_limit !== null) { - for (const e of object.spend_limit) { - message.spend_limit.push(Coin.fromJSON(e)); - } - } - if (object.expiration !== undefined && object.expiration !== null) { - message.expiration = fromJsonTimestamp(object.expiration); - } else { - message.expiration = undefined; - } - return message; - }, - - toJSON(message: BasicAllowance): unknown { - const obj: any = {}; - if (message.spend_limit) { - obj.spend_limit = message.spend_limit.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.spend_limit = []; - } - message.expiration !== undefined && - (obj.expiration = - message.expiration !== undefined - ? message.expiration.toISOString() - : null); - return obj; - }, - - fromPartial(object: DeepPartial): BasicAllowance { - const message = { ...baseBasicAllowance } as BasicAllowance; - message.spend_limit = []; - if (object.spend_limit !== undefined && object.spend_limit !== null) { - for (const e of object.spend_limit) { - message.spend_limit.push(Coin.fromPartial(e)); - } - } - if (object.expiration !== undefined && object.expiration !== null) { - message.expiration = object.expiration; - } else { - message.expiration = undefined; - } - return message; - }, -}; - -const basePeriodicAllowance: object = {}; - -export const PeriodicAllowance = { - encode(message: PeriodicAllowance, writer: Writer = Writer.create()): Writer { - if (message.basic !== undefined) { - BasicAllowance.encode(message.basic, writer.uint32(10).fork()).ldelim(); - } - if (message.period !== undefined) { - Duration.encode(message.period, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.period_spend_limit) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.period_can_spend) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); - } - if (message.period_reset !== undefined) { - Timestamp.encode( - toTimestamp(message.period_reset), - writer.uint32(42).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PeriodicAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePeriodicAllowance } as PeriodicAllowance; - message.period_spend_limit = []; - message.period_can_spend = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.basic = BasicAllowance.decode(reader, reader.uint32()); - break; - case 2: - message.period = Duration.decode(reader, reader.uint32()); - break; - case 3: - message.period_spend_limit.push(Coin.decode(reader, reader.uint32())); - break; - case 4: - message.period_can_spend.push(Coin.decode(reader, reader.uint32())); - break; - case 5: - message.period_reset = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PeriodicAllowance { - const message = { ...basePeriodicAllowance } as PeriodicAllowance; - message.period_spend_limit = []; - message.period_can_spend = []; - if (object.basic !== undefined && object.basic !== null) { - message.basic = BasicAllowance.fromJSON(object.basic); - } else { - message.basic = undefined; - } - if (object.period !== undefined && object.period !== null) { - message.period = Duration.fromJSON(object.period); - } else { - message.period = undefined; - } - if ( - object.period_spend_limit !== undefined && - object.period_spend_limit !== null - ) { - for (const e of object.period_spend_limit) { - message.period_spend_limit.push(Coin.fromJSON(e)); - } - } - if ( - object.period_can_spend !== undefined && - object.period_can_spend !== null - ) { - for (const e of object.period_can_spend) { - message.period_can_spend.push(Coin.fromJSON(e)); - } - } - if (object.period_reset !== undefined && object.period_reset !== null) { - message.period_reset = fromJsonTimestamp(object.period_reset); - } else { - message.period_reset = undefined; - } - return message; - }, - - toJSON(message: PeriodicAllowance): unknown { - const obj: any = {}; - message.basic !== undefined && - (obj.basic = message.basic - ? BasicAllowance.toJSON(message.basic) - : undefined); - message.period !== undefined && - (obj.period = message.period - ? Duration.toJSON(message.period) - : undefined); - if (message.period_spend_limit) { - obj.period_spend_limit = message.period_spend_limit.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.period_spend_limit = []; - } - if (message.period_can_spend) { - obj.period_can_spend = message.period_can_spend.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.period_can_spend = []; - } - message.period_reset !== undefined && - (obj.period_reset = - message.period_reset !== undefined - ? message.period_reset.toISOString() - : null); - return obj; - }, - - fromPartial(object: DeepPartial): PeriodicAllowance { - const message = { ...basePeriodicAllowance } as PeriodicAllowance; - message.period_spend_limit = []; - message.period_can_spend = []; - if (object.basic !== undefined && object.basic !== null) { - message.basic = BasicAllowance.fromPartial(object.basic); - } else { - message.basic = undefined; - } - if (object.period !== undefined && object.period !== null) { - message.period = Duration.fromPartial(object.period); - } else { - message.period = undefined; - } - if ( - object.period_spend_limit !== undefined && - object.period_spend_limit !== null - ) { - for (const e of object.period_spend_limit) { - message.period_spend_limit.push(Coin.fromPartial(e)); - } - } - if ( - object.period_can_spend !== undefined && - object.period_can_spend !== null - ) { - for (const e of object.period_can_spend) { - message.period_can_spend.push(Coin.fromPartial(e)); - } - } - if (object.period_reset !== undefined && object.period_reset !== null) { - message.period_reset = object.period_reset; - } else { - message.period_reset = undefined; - } - return message; - }, -}; - -const baseAllowedMsgAllowance: object = { allowed_messages: "" }; - -export const AllowedMsgAllowance = { - encode( - message: AllowedMsgAllowance, - writer: Writer = Writer.create() - ): Writer { - if (message.allowance !== undefined) { - Any.encode(message.allowance, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.allowed_messages) { - writer.uint32(18).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): AllowedMsgAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAllowedMsgAllowance } as AllowedMsgAllowance; - message.allowed_messages = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowance = Any.decode(reader, reader.uint32()); - break; - case 2: - message.allowed_messages.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AllowedMsgAllowance { - const message = { ...baseAllowedMsgAllowance } as AllowedMsgAllowance; - message.allowed_messages = []; - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromJSON(object.allowance); - } else { - message.allowance = undefined; - } - if ( - object.allowed_messages !== undefined && - object.allowed_messages !== null - ) { - for (const e of object.allowed_messages) { - message.allowed_messages.push(String(e)); - } - } - return message; - }, - - toJSON(message: AllowedMsgAllowance): unknown { - const obj: any = {}; - message.allowance !== undefined && - (obj.allowance = message.allowance - ? Any.toJSON(message.allowance) - : undefined); - if (message.allowed_messages) { - obj.allowed_messages = message.allowed_messages.map((e) => e); - } else { - obj.allowed_messages = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): AllowedMsgAllowance { - const message = { ...baseAllowedMsgAllowance } as AllowedMsgAllowance; - message.allowed_messages = []; - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromPartial(object.allowance); - } else { - message.allowance = undefined; - } - if ( - object.allowed_messages !== undefined && - object.allowed_messages !== null - ) { - for (const e of object.allowed_messages) { - message.allowed_messages.push(e); - } - } - return message; - }, -}; - -const baseGrant: object = { granter: "", grantee: "" }; - -export const Grant = { - encode(message: Grant, writer: Writer = Writer.create()): Writer { - if (message.granter !== "") { - writer.uint32(10).string(message.granter); - } - if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); - } - if (message.allowance !== undefined) { - Any.encode(message.allowance, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Grant { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGrant } as Grant; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.granter = reader.string(); - break; - case 2: - message.grantee = reader.string(); - break; - case 3: - message.allowance = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Grant { - const message = { ...baseGrant } as Grant; - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromJSON(object.allowance); - } else { - message.allowance = undefined; - } - return message; - }, - - toJSON(message: Grant): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - message.allowance !== undefined && - (obj.allowance = message.allowance - ? Any.toJSON(message.allowance) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Grant { - const message = { ...baseGrant } as Grant; - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromPartial(object.allowance); - } else { - message.allowance = undefined; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/genesis.ts deleted file mode 100644 index 3b9371b8..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/genesis.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* eslint-disable */ -import { Grant } from "../../../cosmos/feegrant/v1beta1/feegrant"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.feegrant.v1beta1"; - -/** Since: cosmos-sdk 0.43 */ - -/** GenesisState contains a set of fee allowances, persisted from the store */ -export interface GenesisState { - allowances: Grant[]; -} - -const baseGenesisState: object = {}; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - for (const v of message.allowances) { - Grant.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.allowances = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowances.push(Grant.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.allowances) { - obj.allowances = message.allowances.map((e) => - e ? Grant.toJSON(e) : undefined - ); - } else { - obj.allowances = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromPartial(e)); - } - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/query.ts deleted file mode 100644 index bebb0b18..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/query.ts +++ /dev/null @@ -1,417 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Grant } from "../../../cosmos/feegrant/v1beta1/feegrant"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; - -export const protobufPackage = "cosmos.feegrant.v1beta1"; - -/** Since: cosmos-sdk 0.43 */ - -/** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ -export interface QueryAllowanceRequest { - /** granter is the address of the user granting an allowance of their funds. */ - granter: string; - /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; -} - -/** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ -export interface QueryAllowanceResponse { - /** allowance is a allowance granted for grantee by granter. */ - allowance: Grant | undefined; -} - -/** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ -export interface QueryAllowancesRequest { - grantee: string; - /** pagination defines an pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ -export interface QueryAllowancesResponse { - /** allowances are allowance's granted for grantee by granter. */ - allowances: Grant[]; - /** pagination defines an pagination for the response. */ - pagination: PageResponse | undefined; -} - -const baseQueryAllowanceRequest: object = { granter: "", grantee: "" }; - -export const QueryAllowanceRequest = { - encode( - message: QueryAllowanceRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.granter !== "") { - writer.uint32(10).string(message.granter); - } - if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAllowanceRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAllowanceRequest } as QueryAllowanceRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.granter = reader.string(); - break; - case 2: - message.grantee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllowanceRequest { - const message = { ...baseQueryAllowanceRequest } as QueryAllowanceRequest; - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - return message; - }, - - toJSON(message: QueryAllowanceRequest): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllowanceRequest { - const message = { ...baseQueryAllowanceRequest } as QueryAllowanceRequest; - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } - return message; - }, -}; - -const baseQueryAllowanceResponse: object = {}; - -export const QueryAllowanceResponse = { - encode( - message: QueryAllowanceResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.allowance !== undefined) { - Grant.encode(message.allowance, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAllowanceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAllowanceResponse } as QueryAllowanceResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowance = Grant.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllowanceResponse { - const message = { ...baseQueryAllowanceResponse } as QueryAllowanceResponse; - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Grant.fromJSON(object.allowance); - } else { - message.allowance = undefined; - } - return message; - }, - - toJSON(message: QueryAllowanceResponse): unknown { - const obj: any = {}; - message.allowance !== undefined && - (obj.allowance = message.allowance - ? Grant.toJSON(message.allowance) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllowanceResponse { - const message = { ...baseQueryAllowanceResponse } as QueryAllowanceResponse; - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Grant.fromPartial(object.allowance); - } else { - message.allowance = undefined; - } - return message; - }, -}; - -const baseQueryAllowancesRequest: object = { grantee: "" }; - -export const QueryAllowancesRequest = { - encode( - message: QueryAllowancesRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.grantee !== "") { - writer.uint32(10).string(message.grantee); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAllowancesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAllowancesRequest } as QueryAllowancesRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.grantee = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllowancesRequest { - const message = { ...baseQueryAllowancesRequest } as QueryAllowancesRequest; - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllowancesRequest): unknown { - const obj: any = {}; - message.grantee !== undefined && (obj.grantee = message.grantee); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllowancesRequest { - const message = { ...baseQueryAllowancesRequest } as QueryAllowancesRequest; - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllowancesResponse: object = {}; - -export const QueryAllowancesResponse = { - encode( - message: QueryAllowancesResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.allowances) { - Grant.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAllowancesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllowancesResponse, - } as QueryAllowancesResponse; - message.allowances = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowances.push(Grant.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): QueryAllowancesResponse { - const message = { - ...baseQueryAllowancesResponse, - } as QueryAllowancesResponse; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllowancesResponse): unknown { - const obj: any = {}; - if (message.allowances) { - obj.allowances = message.allowances.map((e) => - e ? Grant.toJSON(e) : undefined - ); - } else { - obj.allowances = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllowancesResponse { - const message = { - ...baseQueryAllowancesResponse, - } as QueryAllowancesResponse; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -/** Query defines the gRPC querier service. */ -export interface Query { - /** Allowance returns fee granted to the grantee by the granter. */ - Allowance(request: QueryAllowanceRequest): Promise; - /** Allowances returns all the grants for address. */ - Allowances(request: QueryAllowancesRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Allowance(request: QueryAllowanceRequest): Promise { - const data = QueryAllowanceRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.feegrant.v1beta1.Query", - "Allowance", - data - ); - return promise.then((data) => - QueryAllowanceResponse.decode(new Reader(data)) - ); - } - - Allowances( - request: QueryAllowancesRequest - ): Promise { - const data = QueryAllowancesRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.feegrant.v1beta1.Query", - "Allowances", - data - ); - return promise.then((data) => - QueryAllowancesResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/tx.ts deleted file mode 100644 index 1206a2bf..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos/feegrant/v1beta1/tx.ts +++ /dev/null @@ -1,376 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; - -export const protobufPackage = "cosmos.feegrant.v1beta1"; - -/** Since: cosmos-sdk 0.43 */ - -/** - * MsgGrantAllowance adds permission for Grantee to spend up to Allowance - * of fees from the account of Granter. - */ -export interface MsgGrantAllowance { - /** granter is the address of the user granting an allowance of their funds. */ - granter: string; - /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; - /** allowance can be any of basic and filtered fee allowance. */ - allowance: Any | undefined; -} - -/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ -export interface MsgGrantAllowanceResponse {} - -/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ -export interface MsgRevokeAllowance { - /** granter is the address of the user granting an allowance of their funds. */ - granter: string; - /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; -} - -/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ -export interface MsgRevokeAllowanceResponse {} - -const baseMsgGrantAllowance: object = { granter: "", grantee: "" }; - -export const MsgGrantAllowance = { - encode(message: MsgGrantAllowance, writer: Writer = Writer.create()): Writer { - if (message.granter !== "") { - writer.uint32(10).string(message.granter); - } - if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); - } - if (message.allowance !== undefined) { - Any.encode(message.allowance, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgGrantAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgGrantAllowance } as MsgGrantAllowance; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.granter = reader.string(); - break; - case 2: - message.grantee = reader.string(); - break; - case 3: - message.allowance = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgGrantAllowance { - const message = { ...baseMsgGrantAllowance } as MsgGrantAllowance; - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromJSON(object.allowance); - } else { - message.allowance = undefined; - } - return message; - }, - - toJSON(message: MsgGrantAllowance): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - message.allowance !== undefined && - (obj.allowance = message.allowance - ? Any.toJSON(message.allowance) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): MsgGrantAllowance { - const message = { ...baseMsgGrantAllowance } as MsgGrantAllowance; - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromPartial(object.allowance); - } else { - message.allowance = undefined; - } - return message; - }, -}; - -const baseMsgGrantAllowanceResponse: object = {}; - -export const MsgGrantAllowanceResponse = { - encode( - _: MsgGrantAllowanceResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgGrantAllowanceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgGrantAllowanceResponse, - } as MsgGrantAllowanceResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgGrantAllowanceResponse { - const message = { - ...baseMsgGrantAllowanceResponse, - } as MsgGrantAllowanceResponse; - return message; - }, - - toJSON(_: MsgGrantAllowanceResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgGrantAllowanceResponse { - const message = { - ...baseMsgGrantAllowanceResponse, - } as MsgGrantAllowanceResponse; - return message; - }, -}; - -const baseMsgRevokeAllowance: object = { granter: "", grantee: "" }; - -export const MsgRevokeAllowance = { - encode( - message: MsgRevokeAllowance, - writer: Writer = Writer.create() - ): Writer { - if (message.granter !== "") { - writer.uint32(10).string(message.granter); - } - if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgRevokeAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgRevokeAllowance } as MsgRevokeAllowance; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.granter = reader.string(); - break; - case 2: - message.grantee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgRevokeAllowance { - const message = { ...baseMsgRevokeAllowance } as MsgRevokeAllowance; - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - return message; - }, - - toJSON(message: MsgRevokeAllowance): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - return obj; - }, - - fromPartial(object: DeepPartial): MsgRevokeAllowance { - const message = { ...baseMsgRevokeAllowance } as MsgRevokeAllowance; - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } - return message; - }, -}; - -const baseMsgRevokeAllowanceResponse: object = {}; - -export const MsgRevokeAllowanceResponse = { - encode( - _: MsgRevokeAllowanceResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgRevokeAllowanceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgRevokeAllowanceResponse, - } as MsgRevokeAllowanceResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgRevokeAllowanceResponse { - const message = { - ...baseMsgRevokeAllowanceResponse, - } as MsgRevokeAllowanceResponse; - return message; - }, - - toJSON(_: MsgRevokeAllowanceResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgRevokeAllowanceResponse { - const message = { - ...baseMsgRevokeAllowanceResponse, - } as MsgRevokeAllowanceResponse; - return message; - }, -}; - -/** Msg defines the feegrant msg service. */ -export interface Msg { - /** - * GrantAllowance grants fee allowance to the grantee on the granter's - * account with the provided expiration time. - */ - GrantAllowance( - request: MsgGrantAllowance - ): Promise; - /** - * RevokeAllowance revokes any fee allowance of granter's account that - * has been granted to the grantee. - */ - RevokeAllowance( - request: MsgRevokeAllowance - ): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - GrantAllowance( - request: MsgGrantAllowance - ): Promise { - const data = MsgGrantAllowance.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.feegrant.v1beta1.Msg", - "GrantAllowance", - data - ); - return promise.then((data) => - MsgGrantAllowanceResponse.decode(new Reader(data)) - ); - } - - RevokeAllowance( - request: MsgRevokeAllowance - ): Promise { - const data = MsgRevokeAllowance.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.feegrant.v1beta1.Msg", - "RevokeAllowance", - data - ); - return promise.then((data) => - MsgRevokeAllowanceResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos_proto/cosmos.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos_proto/cosmos.ts deleted file mode 100644 index 9ec67a12..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/cosmos_proto/cosmos.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "cosmos_proto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/duration.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/duration.ts deleted file mode 100644 index fffd5b14..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/duration.ts +++ /dev/null @@ -1,188 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - */ -export interface Duration { - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ - seconds: number; - /** - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - */ - nanos: number; -} - -const baseDuration: object = { seconds: 0, nanos: 0 }; - -export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDuration } as Duration; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Duration): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/package.json deleted file mode 100644 index 02c3cd3e..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-feegrant-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.feegrant.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/feegrant", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.feegrant.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/index.ts deleted file mode 100644 index 40d635a6..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/index.ts +++ /dev/null @@ -1,484 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { WeightedVoteOption } from "./module/types/cosmos/gov/v1beta1/gov" -import { TextProposal } from "./module/types/cosmos/gov/v1beta1/gov" -import { Deposit } from "./module/types/cosmos/gov/v1beta1/gov" -import { Proposal } from "./module/types/cosmos/gov/v1beta1/gov" -import { TallyResult } from "./module/types/cosmos/gov/v1beta1/gov" -import { Vote } from "./module/types/cosmos/gov/v1beta1/gov" -import { DepositParams } from "./module/types/cosmos/gov/v1beta1/gov" -import { VotingParams } from "./module/types/cosmos/gov/v1beta1/gov" -import { TallyParams } from "./module/types/cosmos/gov/v1beta1/gov" - - -export { WeightedVoteOption, TextProposal, Deposit, Proposal, TallyResult, Vote, DepositParams, VotingParams, TallyParams }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Proposal: {}, - Proposals: {}, - Vote: {}, - Votes: {}, - Params: {}, - Deposit: {}, - Deposits: {}, - TallyResult: {}, - - _Structure: { - WeightedVoteOption: getStructure(WeightedVoteOption.fromPartial({})), - TextProposal: getStructure(TextProposal.fromPartial({})), - Deposit: getStructure(Deposit.fromPartial({})), - Proposal: getStructure(Proposal.fromPartial({})), - TallyResult: getStructure(TallyResult.fromPartial({})), - Vote: getStructure(Vote.fromPartial({})), - DepositParams: getStructure(DepositParams.fromPartial({})), - VotingParams: getStructure(VotingParams.fromPartial({})), - TallyParams: getStructure(TallyParams.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getProposal: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Proposal[JSON.stringify(params)] ?? {} - }, - getProposals: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Proposals[JSON.stringify(params)] ?? {} - }, - getVote: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Vote[JSON.stringify(params)] ?? {} - }, - getVotes: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Votes[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getDeposit: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Deposit[JSON.stringify(params)] ?? {} - }, - getDeposits: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Deposits[JSON.stringify(params)] ?? {} - }, - getTallyResult: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TallyResult[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.gov.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryProposal({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryProposal( key.proposal_id)).data - - - commit('QUERY', { query: 'Proposal', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryProposal', payload: { options: { all }, params: {...key},query }}) - return getters['getProposal']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryProposal API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryProposals({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryProposals(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryProposals({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Proposals', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryProposals', payload: { options: { all }, params: {...key},query }}) - return getters['getProposals']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryProposals API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryVote({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryVote( key.proposal_id, key.voter)).data - - - commit('QUERY', { query: 'Vote', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryVote', payload: { options: { all }, params: {...key},query }}) - return getters['getVote']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryVote API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryVotes({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryVotes( key.proposal_id, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryVotes( key.proposal_id, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Votes', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryVotes', payload: { options: { all }, params: {...key},query }}) - return getters['getVotes']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryVotes API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryParams( key.params_type)).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDeposit({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDeposit( key.proposal_id, key.depositor)).data - - - commit('QUERY', { query: 'Deposit', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDeposit', payload: { options: { all }, params: {...key},query }}) - return getters['getDeposit']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDeposit API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDeposits({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDeposits( key.proposal_id, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryDeposits( key.proposal_id, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Deposits', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDeposits', payload: { options: { all }, params: {...key},query }}) - return getters['getDeposits']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDeposits API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryTallyResult({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryTallyResult( key.proposal_id)).data - - - commit('QUERY', { query: 'TallyResult', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryTallyResult', payload: { options: { all }, params: {...key},query }}) - return getters['getTallyResult']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryTallyResult API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgSubmitProposal({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitProposal(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitProposal:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitProposal:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgVoteWeighted({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgVoteWeighted(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVoteWeighted:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVoteWeighted:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgVote({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgVote(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVote:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVote:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgDeposit({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgDeposit(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeposit:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgDeposit:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgSubmitProposal({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitProposal(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitProposal:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitProposal:Create Could not create message: ' + e.message) - } - } - }, - async MsgVoteWeighted({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgVoteWeighted(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVoteWeighted:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVoteWeighted:Create Could not create message: ' + e.message) - } - } - }, - async MsgVote({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgVote(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgVote:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgVote:Create Could not create message: ' + e.message) - } - } - }, - async MsgDeposit({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgDeposit(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeposit:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgDeposit:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/index.ts deleted file mode 100644 index 03aa2170..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/index.ts +++ /dev/null @@ -1,69 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx"; -import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx"; -import { MsgVote } from "./types/cosmos/gov/v1beta1/tx"; -import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx"; - - -const types = [ - ["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal], - ["/cosmos.gov.v1beta1.MsgVoteWeighted", MsgVoteWeighted], - ["/cosmos.gov.v1beta1.MsgVote", MsgVote], - ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgSubmitProposal: (data: MsgSubmitProposal): EncodeObject => ({ typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( data ) }), - msgVoteWeighted: (data: MsgVoteWeighted): EncodeObject => ({ typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", value: MsgVoteWeighted.fromPartial( data ) }), - msgVote: (data: MsgVote): EncodeObject => ({ typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: MsgVote.fromPartial( data ) }), - msgDeposit: (data: MsgDeposit): EncodeObject => ({ typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: MsgDeposit.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/rest.ts deleted file mode 100644 index d13cb4ec..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/rest.ts +++ /dev/null @@ -1,950 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* 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 V1Beta1Coin { - denom?: string; - amount?: string; -} - -/** -* Deposit defines an amount deposited by an account address to an active -proposal. -*/ -export interface V1Beta1Deposit { - /** @format uint64 */ - proposal_id?: string; - depositor?: string; - amount?: V1Beta1Coin[]; -} - -/** - * DepositParams defines the params for deposits on governance proposals. - */ -export interface V1Beta1DepositParams { - /** Minimum deposit for a proposal to enter voting period. */ - min_deposit?: V1Beta1Coin[]; - - /** - * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. - */ - max_deposit_period?: string; -} - -/** - * MsgDepositResponse defines the Msg/Deposit response type. - */ -export type V1Beta1MsgDepositResponse = object; - -/** - * MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. - */ -export interface V1Beta1MsgSubmitProposalResponse { - /** @format uint64 */ - proposal_id?: string; -} - -/** - * MsgVoteResponse defines the Msg/Vote response type. - */ -export type V1Beta1MsgVoteResponse = object; - -/** -* MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. - -Since: cosmos-sdk 0.43 -*/ -export type V1Beta1MsgVoteWeightedResponse = object; - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * Proposal defines the core field members of a governance proposal. - */ -export interface V1Beta1Proposal { - /** @format uint64 */ - proposal_id?: string; - - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - content?: ProtobufAny; - - /** - * ProposalStatus enumerates the valid statuses of a proposal. - * - * - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. - * - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - * period. - * - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - * period. - * - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - * passed. - * - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - * been rejected. - * - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - * failed. - */ - status?: V1Beta1ProposalStatus; - - /** TallyResult defines a standard tally for a governance proposal. */ - final_tally_result?: V1Beta1TallyResult; - - /** @format date-time */ - submit_time?: string; - - /** @format date-time */ - deposit_end_time?: string; - total_deposit?: V1Beta1Coin[]; - - /** @format date-time */ - voting_start_time?: string; - - /** @format date-time */ - voting_end_time?: string; -} - -/** -* ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit -period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting -period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has -passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has -been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has -failed. -*/ -export enum V1Beta1ProposalStatus { - PROPOSAL_STATUS_UNSPECIFIED = "PROPOSAL_STATUS_UNSPECIFIED", - PROPOSAL_STATUS_DEPOSIT_PERIOD = "PROPOSAL_STATUS_DEPOSIT_PERIOD", - PROPOSAL_STATUS_VOTING_PERIOD = "PROPOSAL_STATUS_VOTING_PERIOD", - PROPOSAL_STATUS_PASSED = "PROPOSAL_STATUS_PASSED", - PROPOSAL_STATUS_REJECTED = "PROPOSAL_STATUS_REJECTED", - PROPOSAL_STATUS_FAILED = "PROPOSAL_STATUS_FAILED", -} - -/** - * QueryDepositResponse is the response type for the Query/Deposit RPC method. - */ -export interface V1Beta1QueryDepositResponse { - /** deposit defines the requested deposit. */ - deposit?: V1Beta1Deposit; -} - -/** - * QueryDepositsResponse is the response type for the Query/Deposits RPC method. - */ -export interface V1Beta1QueryDepositsResponse { - deposits?: V1Beta1Deposit[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * QueryParamsResponse is the response type for the Query/Params RPC method. - */ -export interface V1Beta1QueryParamsResponse { - /** voting_params defines the parameters related to voting. */ - voting_params?: V1Beta1VotingParams; - - /** deposit_params defines the parameters related to deposit. */ - deposit_params?: V1Beta1DepositParams; - - /** tally_params defines the parameters related to tally. */ - tally_params?: V1Beta1TallyParams; -} - -/** - * QueryProposalResponse is the response type for the Query/Proposal RPC method. - */ -export interface V1Beta1QueryProposalResponse { - /** Proposal defines the core field members of a governance proposal. */ - proposal?: V1Beta1Proposal; -} - -/** -* QueryProposalsResponse is the response type for the Query/Proposals RPC -method. -*/ -export interface V1Beta1QueryProposalsResponse { - proposals?: V1Beta1Proposal[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * QueryTallyResultResponse is the response type for the Query/Tally RPC method. - */ -export interface V1Beta1QueryTallyResultResponse { - /** tally defines the requested tally. */ - tally?: V1Beta1TallyResult; -} - -/** - * QueryVoteResponse is the response type for the Query/Vote RPC method. - */ -export interface V1Beta1QueryVoteResponse { - /** vote defined the queried vote. */ - vote?: V1Beta1Vote; -} - -/** - * QueryVotesResponse is the response type for the Query/Votes RPC method. - */ -export interface V1Beta1QueryVotesResponse { - /** votes defined the queried votes. */ - votes?: V1Beta1Vote[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * TallyParams defines the params for tallying votes on governance proposals. - */ -export interface V1Beta1TallyParams { - /** - * Minimum percentage of total stake needed to vote for a result to be - * considered valid. - * @format byte - */ - quorum?: string; - - /** - * Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - * @format byte - */ - threshold?: string; - - /** - * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. - * @format byte - */ - veto_threshold?: string; -} - -/** - * TallyResult defines a standard tally for a governance proposal. - */ -export interface V1Beta1TallyResult { - yes?: string; - abstain?: string; - no?: string; - no_with_veto?: string; -} - -/** -* Vote defines a vote on a governance proposal. -A Vote consists of a proposal ID, the voter, and the vote option. -*/ -export interface V1Beta1Vote { - /** @format uint64 */ - proposal_id?: string; - voter?: string; - - /** - * Deprecated: Prefer to use `options` instead. This field is set in queries - * if and only if `len(options) == 1` and that option has weight 1. In all - * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - */ - option?: V1Beta1VoteOption; - options?: V1Beta1WeightedVoteOption[]; -} - -/** -* VoteOption enumerates the valid vote options for a given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. -*/ -export enum V1Beta1VoteOption { - VOTE_OPTION_UNSPECIFIED = "VOTE_OPTION_UNSPECIFIED", - VOTE_OPTION_YES = "VOTE_OPTION_YES", - VOTE_OPTION_ABSTAIN = "VOTE_OPTION_ABSTAIN", - VOTE_OPTION_NO = "VOTE_OPTION_NO", - VOTE_OPTION_NO_WITH_VETO = "VOTE_OPTION_NO_WITH_VETO", -} - -/** - * VotingParams defines the params for voting on governance proposals. - */ -export interface V1Beta1VotingParams { - /** Length of the voting period. */ - voting_period?: string; -} - -/** -* WeightedVoteOption defines a unit of vote for vote split. - -Since: cosmos-sdk 0.43 -*/ -export interface V1Beta1WeightedVoteOption { - /** - * VoteOption enumerates the valid vote options for a given governance proposal. - * - * - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - * - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - * - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - * - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - * - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - */ - option?: V1Beta1VoteOption; - weight?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/gov/v1beta1/genesis.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryParams - * @summary Params queries all parameters of the gov module. - * @request GET:/cosmos/gov/v1beta1/params/{params_type} - */ - queryParams = (params_type: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/gov/v1beta1/params/${params_type}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryProposals - * @summary Proposals queries all proposals based on given status. - * @request GET:/cosmos/gov/v1beta1/proposals - */ - queryProposals = ( - query?: { - proposal_status?: - | "PROPOSAL_STATUS_UNSPECIFIED" - | "PROPOSAL_STATUS_DEPOSIT_PERIOD" - | "PROPOSAL_STATUS_VOTING_PERIOD" - | "PROPOSAL_STATUS_PASSED" - | "PROPOSAL_STATUS_REJECTED" - | "PROPOSAL_STATUS_FAILED"; - voter?: string; - depositor?: string; - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/gov/v1beta1/proposals`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryProposal - * @summary Proposal queries proposal details based on ProposalID. - * @request GET:/cosmos/gov/v1beta1/proposals/{proposal_id} - */ - queryProposal = (proposal_id: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDeposits - * @summary Deposits queries all deposits of a single proposal. - * @request GET:/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits - */ - queryDeposits = ( - proposal_id: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/deposits`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDeposit - * @summary Deposit queries single deposit information based proposalID, depositAddr. - * @request GET:/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor} - */ - queryDeposit = (proposal_id: string, depositor: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/deposits/${depositor}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryTallyResult - * @summary TallyResult queries the tally of a proposal vote. - * @request GET:/cosmos/gov/v1beta1/proposals/{proposal_id}/tally - */ - queryTallyResult = (proposal_id: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/tally`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryVotes - * @summary Votes queries votes of a given proposal. - * @request GET:/cosmos/gov/v1beta1/proposals/{proposal_id}/votes - */ - queryVotes = ( - proposal_id: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/votes`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryVote - * @summary Vote queries voted information based on proposalID, voterAddr. - * @request GET:/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter} - */ - queryVote = (proposal_id: string, voter: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/votes/${voter}`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ce2ac984..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - 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 { - denom: string; - amount: string; -} - -/** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProto { - int: string; -} - -/** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProto { - dec: string; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - 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 { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - 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): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { - if (message.int !== "") { - writer.uint32(10).string(message.int); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - 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 { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { - if (message.dec !== "") { - writer.uint32(10).string(message.dec); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - 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 { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/genesis.ts deleted file mode 100644 index 22a4738d..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/genesis.ts +++ /dev/null @@ -1,274 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - Deposit, - Vote, - Proposal, - DepositParams, - VotingParams, - TallyParams, -} from "../../../cosmos/gov/v1beta1/gov"; - -export const protobufPackage = "cosmos.gov.v1beta1"; - -/** GenesisState defines the gov module's genesis state. */ -export interface GenesisState { - /** starting_proposal_id is the ID of the starting proposal. */ - starting_proposal_id: number; - /** deposits defines all the deposits present at genesis. */ - deposits: Deposit[]; - /** votes defines all the votes present at genesis. */ - votes: Vote[]; - /** proposals defines all the proposals present at genesis. */ - proposals: Proposal[]; - /** params defines all the paramaters of related to deposit. */ - deposit_params: DepositParams | undefined; - /** params defines all the paramaters of related to voting. */ - voting_params: VotingParams | undefined; - /** params defines all the paramaters of related to tally. */ - tally_params: TallyParams | undefined; -} - -const baseGenesisState: object = { starting_proposal_id: 0 }; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.starting_proposal_id !== 0) { - writer.uint32(8).uint64(message.starting_proposal_id); - } - for (const v of message.deposits) { - Deposit.encode(v!, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.votes) { - Vote.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.proposals) { - Proposal.encode(v!, writer.uint32(34).fork()).ldelim(); - } - if (message.deposit_params !== undefined) { - DepositParams.encode( - message.deposit_params, - writer.uint32(42).fork() - ).ldelim(); - } - if (message.voting_params !== undefined) { - VotingParams.encode( - message.voting_params, - writer.uint32(50).fork() - ).ldelim(); - } - if (message.tally_params !== undefined) { - TallyParams.encode( - message.tally_params, - writer.uint32(58).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.deposits = []; - message.votes = []; - message.proposals = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.starting_proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.deposits.push(Deposit.decode(reader, reader.uint32())); - break; - case 3: - message.votes.push(Vote.decode(reader, reader.uint32())); - break; - case 4: - message.proposals.push(Proposal.decode(reader, reader.uint32())); - break; - case 5: - message.deposit_params = DepositParams.decode( - reader, - reader.uint32() - ); - break; - case 6: - message.voting_params = VotingParams.decode(reader, reader.uint32()); - break; - case 7: - message.tally_params = TallyParams.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.deposits = []; - message.votes = []; - message.proposals = []; - if ( - object.starting_proposal_id !== undefined && - object.starting_proposal_id !== null - ) { - message.starting_proposal_id = Number(object.starting_proposal_id); - } else { - message.starting_proposal_id = 0; - } - if (object.deposits !== undefined && object.deposits !== null) { - for (const e of object.deposits) { - message.deposits.push(Deposit.fromJSON(e)); - } - } - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(Vote.fromJSON(e)); - } - } - if (object.proposals !== undefined && object.proposals !== null) { - for (const e of object.proposals) { - message.proposals.push(Proposal.fromJSON(e)); - } - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.deposit_params = DepositParams.fromJSON(object.deposit_params); - } else { - message.deposit_params = undefined; - } - if (object.voting_params !== undefined && object.voting_params !== null) { - message.voting_params = VotingParams.fromJSON(object.voting_params); - } else { - message.voting_params = undefined; - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tally_params = TallyParams.fromJSON(object.tally_params); - } else { - message.tally_params = undefined; - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.starting_proposal_id !== undefined && - (obj.starting_proposal_id = message.starting_proposal_id); - if (message.deposits) { - obj.deposits = message.deposits.map((e) => - e ? Deposit.toJSON(e) : undefined - ); - } else { - obj.deposits = []; - } - if (message.votes) { - obj.votes = message.votes.map((e) => (e ? Vote.toJSON(e) : undefined)); - } else { - obj.votes = []; - } - if (message.proposals) { - obj.proposals = message.proposals.map((e) => - e ? Proposal.toJSON(e) : undefined - ); - } else { - obj.proposals = []; - } - message.deposit_params !== undefined && - (obj.deposit_params = message.deposit_params - ? DepositParams.toJSON(message.deposit_params) - : undefined); - message.voting_params !== undefined && - (obj.voting_params = message.voting_params - ? VotingParams.toJSON(message.voting_params) - : undefined); - message.tally_params !== undefined && - (obj.tally_params = message.tally_params - ? TallyParams.toJSON(message.tally_params) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.deposits = []; - message.votes = []; - message.proposals = []; - if ( - object.starting_proposal_id !== undefined && - object.starting_proposal_id !== null - ) { - message.starting_proposal_id = object.starting_proposal_id; - } else { - message.starting_proposal_id = 0; - } - if (object.deposits !== undefined && object.deposits !== null) { - for (const e of object.deposits) { - message.deposits.push(Deposit.fromPartial(e)); - } - } - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(Vote.fromPartial(e)); - } - } - if (object.proposals !== undefined && object.proposals !== null) { - for (const e of object.proposals) { - message.proposals.push(Proposal.fromPartial(e)); - } - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.deposit_params = DepositParams.fromPartial(object.deposit_params); - } else { - message.deposit_params = undefined; - } - if (object.voting_params !== undefined && object.voting_params !== null) { - message.voting_params = VotingParams.fromPartial(object.voting_params); - } else { - message.voting_params = undefined; - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tally_params = TallyParams.fromPartial(object.tally_params); - } else { - message.tally_params = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/gov.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/gov.ts deleted file mode 100644 index 71ffdf31..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/gov.ts +++ /dev/null @@ -1,1323 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Any } from "../../../google/protobuf/any"; -import { Duration } from "../../../google/protobuf/duration"; - -export const protobufPackage = "cosmos.gov.v1beta1"; - -/** VoteOption enumerates the valid vote options for a given governance proposal. */ -export enum VoteOption { - /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ - VOTE_OPTION_UNSPECIFIED = 0, - /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ - VOTE_OPTION_YES = 1, - /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ - VOTE_OPTION_ABSTAIN = 2, - /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ - VOTE_OPTION_NO = 3, - /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ - VOTE_OPTION_NO_WITH_VETO = 4, - UNRECOGNIZED = -1, -} - -export function voteOptionFromJSON(object: any): VoteOption { - switch (object) { - case 0: - case "VOTE_OPTION_UNSPECIFIED": - return VoteOption.VOTE_OPTION_UNSPECIFIED; - case 1: - case "VOTE_OPTION_YES": - return VoteOption.VOTE_OPTION_YES; - case 2: - case "VOTE_OPTION_ABSTAIN": - return VoteOption.VOTE_OPTION_ABSTAIN; - case 3: - case "VOTE_OPTION_NO": - return VoteOption.VOTE_OPTION_NO; - case 4: - case "VOTE_OPTION_NO_WITH_VETO": - return VoteOption.VOTE_OPTION_NO_WITH_VETO; - case -1: - case "UNRECOGNIZED": - default: - return VoteOption.UNRECOGNIZED; - } -} - -export function voteOptionToJSON(object: VoteOption): string { - switch (object) { - case VoteOption.VOTE_OPTION_UNSPECIFIED: - return "VOTE_OPTION_UNSPECIFIED"; - case VoteOption.VOTE_OPTION_YES: - return "VOTE_OPTION_YES"; - case VoteOption.VOTE_OPTION_ABSTAIN: - return "VOTE_OPTION_ABSTAIN"; - case VoteOption.VOTE_OPTION_NO: - return "VOTE_OPTION_NO"; - case VoteOption.VOTE_OPTION_NO_WITH_VETO: - return "VOTE_OPTION_NO_WITH_VETO"; - default: - return "UNKNOWN"; - } -} - -/** ProposalStatus enumerates the valid statuses of a proposal. */ -export enum ProposalStatus { - /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ - PROPOSAL_STATUS_UNSPECIFIED = 0, - /** - * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - * period. - */ - PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, - /** - * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - * period. - */ - PROPOSAL_STATUS_VOTING_PERIOD = 2, - /** - * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - * passed. - */ - PROPOSAL_STATUS_PASSED = 3, - /** - * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - * been rejected. - */ - PROPOSAL_STATUS_REJECTED = 4, - /** - * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - * failed. - */ - PROPOSAL_STATUS_FAILED = 5, - UNRECOGNIZED = -1, -} - -export function proposalStatusFromJSON(object: any): ProposalStatus { - switch (object) { - case 0: - case "PROPOSAL_STATUS_UNSPECIFIED": - return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; - case 1: - case "PROPOSAL_STATUS_DEPOSIT_PERIOD": - return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD; - case 2: - case "PROPOSAL_STATUS_VOTING_PERIOD": - return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD; - case 3: - case "PROPOSAL_STATUS_PASSED": - return ProposalStatus.PROPOSAL_STATUS_PASSED; - case 4: - case "PROPOSAL_STATUS_REJECTED": - return ProposalStatus.PROPOSAL_STATUS_REJECTED; - case 5: - case "PROPOSAL_STATUS_FAILED": - return ProposalStatus.PROPOSAL_STATUS_FAILED; - case -1: - case "UNRECOGNIZED": - default: - return ProposalStatus.UNRECOGNIZED; - } -} - -export function proposalStatusToJSON(object: ProposalStatus): string { - switch (object) { - case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: - return "PROPOSAL_STATUS_UNSPECIFIED"; - case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: - return "PROPOSAL_STATUS_DEPOSIT_PERIOD"; - case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: - return "PROPOSAL_STATUS_VOTING_PERIOD"; - case ProposalStatus.PROPOSAL_STATUS_PASSED: - return "PROPOSAL_STATUS_PASSED"; - case ProposalStatus.PROPOSAL_STATUS_REJECTED: - return "PROPOSAL_STATUS_REJECTED"; - case ProposalStatus.PROPOSAL_STATUS_FAILED: - return "PROPOSAL_STATUS_FAILED"; - default: - return "UNKNOWN"; - } -} - -/** - * WeightedVoteOption defines a unit of vote for vote split. - * - * Since: cosmos-sdk 0.43 - */ -export interface WeightedVoteOption { - option: VoteOption; - weight: string; -} - -/** - * TextProposal defines a standard text proposal whose changes need to be - * manually updated in case of approval. - */ -export interface TextProposal { - title: string; - description: string; -} - -/** - * Deposit defines an amount deposited by an account address to an active - * proposal. - */ -export interface Deposit { - proposal_id: number; - depositor: string; - amount: Coin[]; -} - -/** Proposal defines the core field members of a governance proposal. */ -export interface Proposal { - proposal_id: number; - content: Any | undefined; - status: ProposalStatus; - final_tally_result: TallyResult | undefined; - submit_time: Date | undefined; - deposit_end_time: Date | undefined; - total_deposit: Coin[]; - voting_start_time: Date | undefined; - voting_end_time: Date | undefined; -} - -/** TallyResult defines a standard tally for a governance proposal. */ -export interface TallyResult { - yes: string; - abstain: string; - no: string; - no_with_veto: string; -} - -/** - * Vote defines a vote on a governance proposal. - * A Vote consists of a proposal ID, the voter, and the vote option. - */ -export interface Vote { - proposal_id: number; - voter: string; - /** - * Deprecated: Prefer to use `options` instead. This field is set in queries - * if and only if `len(options) == 1` and that option has weight 1. In all - * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - * - * @deprecated - */ - option: VoteOption; - /** Since: cosmos-sdk 0.43 */ - options: WeightedVoteOption[]; -} - -/** DepositParams defines the params for deposits on governance proposals. */ -export interface DepositParams { - /** Minimum deposit for a proposal to enter voting period. */ - min_deposit: Coin[]; - /** - * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. - */ - max_deposit_period: Duration | undefined; -} - -/** VotingParams defines the params for voting on governance proposals. */ -export interface VotingParams { - /** Length of the voting period. */ - voting_period: Duration | undefined; -} - -/** TallyParams defines the params for tallying votes on governance proposals. */ -export interface TallyParams { - /** - * Minimum percentage of total stake needed to vote for a result to be - * considered valid. - */ - quorum: Uint8Array; - /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ - threshold: Uint8Array; - /** - * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. - */ - veto_threshold: Uint8Array; -} - -const baseWeightedVoteOption: object = { option: 0, weight: "" }; - -export const WeightedVoteOption = { - encode( - message: WeightedVoteOption, - writer: Writer = Writer.create() - ): Writer { - if (message.option !== 0) { - writer.uint32(8).int32(message.option); - } - if (message.weight !== "") { - writer.uint32(18).string(message.weight); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): WeightedVoteOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseWeightedVoteOption } as WeightedVoteOption; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.option = reader.int32() as any; - break; - case 2: - message.weight = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): WeightedVoteOption { - const message = { ...baseWeightedVoteOption } as WeightedVoteOption; - if (object.option !== undefined && object.option !== null) { - message.option = voteOptionFromJSON(object.option); - } else { - message.option = 0; - } - if (object.weight !== undefined && object.weight !== null) { - message.weight = String(object.weight); - } else { - message.weight = ""; - } - return message; - }, - - toJSON(message: WeightedVoteOption): unknown { - const obj: any = {}; - message.option !== undefined && - (obj.option = voteOptionToJSON(message.option)); - message.weight !== undefined && (obj.weight = message.weight); - return obj; - }, - - fromPartial(object: DeepPartial): WeightedVoteOption { - const message = { ...baseWeightedVoteOption } as WeightedVoteOption; - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } else { - message.option = 0; - } - if (object.weight !== undefined && object.weight !== null) { - message.weight = object.weight; - } else { - message.weight = ""; - } - return message; - }, -}; - -const baseTextProposal: object = { title: "", description: "" }; - -export const TextProposal = { - encode(message: TextProposal, writer: Writer = Writer.create()): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TextProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTextProposal } as TextProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TextProposal { - const message = { ...baseTextProposal } as TextProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - return message; - }, - - toJSON(message: TextProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - return obj; - }, - - fromPartial(object: DeepPartial): TextProposal { - const message = { ...baseTextProposal } as TextProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - return message; - }, -}; - -const baseDeposit: object = { proposal_id: 0, depositor: "" }; - -export const Deposit = { - encode(message: Deposit, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.depositor !== "") { - writer.uint32(18).string(message.depositor); - } - for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Deposit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDeposit } as Deposit; - message.amount = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.depositor = reader.string(); - break; - case 3: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Deposit { - const message = { ...baseDeposit } as Deposit; - message.amount = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Deposit): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.depositor !== undefined && (obj.depositor = message.depositor); - if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.amount = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Deposit { - const message = { ...baseDeposit } as Deposit; - message.amount = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseProposal: object = { proposal_id: 0, status: 0 }; - -export const Proposal = { - encode(message: Proposal, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.content !== undefined) { - Any.encode(message.content, writer.uint32(18).fork()).ldelim(); - } - if (message.status !== 0) { - writer.uint32(24).int32(message.status); - } - if (message.final_tally_result !== undefined) { - TallyResult.encode( - message.final_tally_result, - writer.uint32(34).fork() - ).ldelim(); - } - if (message.submit_time !== undefined) { - Timestamp.encode( - toTimestamp(message.submit_time), - writer.uint32(42).fork() - ).ldelim(); - } - if (message.deposit_end_time !== undefined) { - Timestamp.encode( - toTimestamp(message.deposit_end_time), - writer.uint32(50).fork() - ).ldelim(); - } - for (const v of message.total_deposit) { - Coin.encode(v!, writer.uint32(58).fork()).ldelim(); - } - if (message.voting_start_time !== undefined) { - Timestamp.encode( - toTimestamp(message.voting_start_time), - writer.uint32(66).fork() - ).ldelim(); - } - if (message.voting_end_time !== undefined) { - Timestamp.encode( - toTimestamp(message.voting_end_time), - writer.uint32(74).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProposal } as Proposal; - message.total_deposit = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.content = Any.decode(reader, reader.uint32()); - break; - case 3: - message.status = reader.int32() as any; - break; - case 4: - message.final_tally_result = TallyResult.decode( - reader, - reader.uint32() - ); - break; - case 5: - message.submit_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 6: - message.deposit_end_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 7: - message.total_deposit.push(Coin.decode(reader, reader.uint32())); - break; - case 8: - message.voting_start_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 9: - message.voting_end_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Proposal { - const message = { ...baseProposal } as Proposal; - message.total_deposit = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.content !== undefined && object.content !== null) { - message.content = Any.fromJSON(object.content); - } else { - message.content = undefined; - } - if (object.status !== undefined && object.status !== null) { - message.status = proposalStatusFromJSON(object.status); - } else { - message.status = 0; - } - if ( - object.final_tally_result !== undefined && - object.final_tally_result !== null - ) { - message.final_tally_result = TallyResult.fromJSON( - object.final_tally_result - ); - } else { - message.final_tally_result = undefined; - } - if (object.submit_time !== undefined && object.submit_time !== null) { - message.submit_time = fromJsonTimestamp(object.submit_time); - } else { - message.submit_time = undefined; - } - if ( - object.deposit_end_time !== undefined && - object.deposit_end_time !== null - ) { - message.deposit_end_time = fromJsonTimestamp(object.deposit_end_time); - } else { - message.deposit_end_time = undefined; - } - if (object.total_deposit !== undefined && object.total_deposit !== null) { - for (const e of object.total_deposit) { - message.total_deposit.push(Coin.fromJSON(e)); - } - } - if ( - object.voting_start_time !== undefined && - object.voting_start_time !== null - ) { - message.voting_start_time = fromJsonTimestamp(object.voting_start_time); - } else { - message.voting_start_time = undefined; - } - if ( - object.voting_end_time !== undefined && - object.voting_end_time !== null - ) { - message.voting_end_time = fromJsonTimestamp(object.voting_end_time); - } else { - message.voting_end_time = undefined; - } - return message; - }, - - toJSON(message: Proposal): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.content !== undefined && - (obj.content = message.content ? Any.toJSON(message.content) : undefined); - message.status !== undefined && - (obj.status = proposalStatusToJSON(message.status)); - message.final_tally_result !== undefined && - (obj.final_tally_result = message.final_tally_result - ? TallyResult.toJSON(message.final_tally_result) - : undefined); - message.submit_time !== undefined && - (obj.submit_time = - message.submit_time !== undefined - ? message.submit_time.toISOString() - : null); - message.deposit_end_time !== undefined && - (obj.deposit_end_time = - message.deposit_end_time !== undefined - ? message.deposit_end_time.toISOString() - : null); - if (message.total_deposit) { - obj.total_deposit = message.total_deposit.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.total_deposit = []; - } - message.voting_start_time !== undefined && - (obj.voting_start_time = - message.voting_start_time !== undefined - ? message.voting_start_time.toISOString() - : null); - message.voting_end_time !== undefined && - (obj.voting_end_time = - message.voting_end_time !== undefined - ? message.voting_end_time.toISOString() - : null); - return obj; - }, - - fromPartial(object: DeepPartial): Proposal { - const message = { ...baseProposal } as Proposal; - message.total_deposit = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.content !== undefined && object.content !== null) { - message.content = Any.fromPartial(object.content); - } else { - message.content = undefined; - } - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } else { - message.status = 0; - } - if ( - object.final_tally_result !== undefined && - object.final_tally_result !== null - ) { - message.final_tally_result = TallyResult.fromPartial( - object.final_tally_result - ); - } else { - message.final_tally_result = undefined; - } - if (object.submit_time !== undefined && object.submit_time !== null) { - message.submit_time = object.submit_time; - } else { - message.submit_time = undefined; - } - if ( - object.deposit_end_time !== undefined && - object.deposit_end_time !== null - ) { - message.deposit_end_time = object.deposit_end_time; - } else { - message.deposit_end_time = undefined; - } - if (object.total_deposit !== undefined && object.total_deposit !== null) { - for (const e of object.total_deposit) { - message.total_deposit.push(Coin.fromPartial(e)); - } - } - if ( - object.voting_start_time !== undefined && - object.voting_start_time !== null - ) { - message.voting_start_time = object.voting_start_time; - } else { - message.voting_start_time = undefined; - } - if ( - object.voting_end_time !== undefined && - object.voting_end_time !== null - ) { - message.voting_end_time = object.voting_end_time; - } else { - message.voting_end_time = undefined; - } - return message; - }, -}; - -const baseTallyResult: object = { - yes: "", - abstain: "", - no: "", - no_with_veto: "", -}; - -export const TallyResult = { - encode(message: TallyResult, writer: Writer = Writer.create()): Writer { - if (message.yes !== "") { - writer.uint32(10).string(message.yes); - } - if (message.abstain !== "") { - writer.uint32(18).string(message.abstain); - } - if (message.no !== "") { - writer.uint32(26).string(message.no); - } - if (message.no_with_veto !== "") { - writer.uint32(34).string(message.no_with_veto); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TallyResult { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTallyResult } as TallyResult; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.yes = reader.string(); - break; - case 2: - message.abstain = reader.string(); - break; - case 3: - message.no = reader.string(); - break; - case 4: - message.no_with_veto = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TallyResult { - const message = { ...baseTallyResult } as TallyResult; - if (object.yes !== undefined && object.yes !== null) { - message.yes = String(object.yes); - } else { - message.yes = ""; - } - if (object.abstain !== undefined && object.abstain !== null) { - message.abstain = String(object.abstain); - } else { - message.abstain = ""; - } - if (object.no !== undefined && object.no !== null) { - message.no = String(object.no); - } else { - message.no = ""; - } - if (object.no_with_veto !== undefined && object.no_with_veto !== null) { - message.no_with_veto = String(object.no_with_veto); - } else { - message.no_with_veto = ""; - } - return message; - }, - - toJSON(message: TallyResult): unknown { - const obj: any = {}; - message.yes !== undefined && (obj.yes = message.yes); - message.abstain !== undefined && (obj.abstain = message.abstain); - message.no !== undefined && (obj.no = message.no); - message.no_with_veto !== undefined && - (obj.no_with_veto = message.no_with_veto); - return obj; - }, - - fromPartial(object: DeepPartial): TallyResult { - const message = { ...baseTallyResult } as TallyResult; - if (object.yes !== undefined && object.yes !== null) { - message.yes = object.yes; - } else { - message.yes = ""; - } - if (object.abstain !== undefined && object.abstain !== null) { - message.abstain = object.abstain; - } else { - message.abstain = ""; - } - if (object.no !== undefined && object.no !== null) { - message.no = object.no; - } else { - message.no = ""; - } - if (object.no_with_veto !== undefined && object.no_with_veto !== null) { - message.no_with_veto = object.no_with_veto; - } else { - message.no_with_veto = ""; - } - return message; - }, -}; - -const baseVote: object = { proposal_id: 0, voter: "", option: 0 }; - -export const Vote = { - encode(message: Vote, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.voter !== "") { - writer.uint32(18).string(message.voter); - } - if (message.option !== 0) { - writer.uint32(24).int32(message.option); - } - for (const v of message.options) { - WeightedVoteOption.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVote } as Vote; - message.options = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.option = reader.int32() as any; - break; - case 4: - message.options.push( - WeightedVoteOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Vote { - const message = { ...baseVote } as Vote; - message.options = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - if (object.option !== undefined && object.option !== null) { - message.option = voteOptionFromJSON(object.option); - } else { - message.option = 0; - } - if (object.options !== undefined && object.options !== null) { - for (const e of object.options) { - message.options.push(WeightedVoteOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Vote): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.voter !== undefined && (obj.voter = message.voter); - message.option !== undefined && - (obj.option = voteOptionToJSON(message.option)); - if (message.options) { - obj.options = message.options.map((e) => - e ? WeightedVoteOption.toJSON(e) : undefined - ); - } else { - obj.options = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Vote { - const message = { ...baseVote } as Vote; - message.options = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } else { - message.option = 0; - } - if (object.options !== undefined && object.options !== null) { - for (const e of object.options) { - message.options.push(WeightedVoteOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseDepositParams: object = {}; - -export const DepositParams = { - encode(message: DepositParams, writer: Writer = Writer.create()): Writer { - for (const v of message.min_deposit) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.max_deposit_period !== undefined) { - Duration.encode( - message.max_deposit_period, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DepositParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDepositParams } as DepositParams; - message.min_deposit = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.min_deposit.push(Coin.decode(reader, reader.uint32())); - break; - case 2: - message.max_deposit_period = Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DepositParams { - const message = { ...baseDepositParams } as DepositParams; - message.min_deposit = []; - if (object.min_deposit !== undefined && object.min_deposit !== null) { - for (const e of object.min_deposit) { - message.min_deposit.push(Coin.fromJSON(e)); - } - } - if ( - object.max_deposit_period !== undefined && - object.max_deposit_period !== null - ) { - message.max_deposit_period = Duration.fromJSON(object.max_deposit_period); - } else { - message.max_deposit_period = undefined; - } - return message; - }, - - toJSON(message: DepositParams): unknown { - const obj: any = {}; - if (message.min_deposit) { - obj.min_deposit = message.min_deposit.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.min_deposit = []; - } - message.max_deposit_period !== undefined && - (obj.max_deposit_period = message.max_deposit_period - ? Duration.toJSON(message.max_deposit_period) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): DepositParams { - const message = { ...baseDepositParams } as DepositParams; - message.min_deposit = []; - if (object.min_deposit !== undefined && object.min_deposit !== null) { - for (const e of object.min_deposit) { - message.min_deposit.push(Coin.fromPartial(e)); - } - } - if ( - object.max_deposit_period !== undefined && - object.max_deposit_period !== null - ) { - message.max_deposit_period = Duration.fromPartial( - object.max_deposit_period - ); - } else { - message.max_deposit_period = undefined; - } - return message; - }, -}; - -const baseVotingParams: object = {}; - -export const VotingParams = { - encode(message: VotingParams, writer: Writer = Writer.create()): Writer { - if (message.voting_period !== undefined) { - Duration.encode(message.voting_period, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): VotingParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVotingParams } as VotingParams; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.voting_period = Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): VotingParams { - const message = { ...baseVotingParams } as VotingParams; - if (object.voting_period !== undefined && object.voting_period !== null) { - message.voting_period = Duration.fromJSON(object.voting_period); - } else { - message.voting_period = undefined; - } - return message; - }, - - toJSON(message: VotingParams): unknown { - const obj: any = {}; - message.voting_period !== undefined && - (obj.voting_period = message.voting_period - ? Duration.toJSON(message.voting_period) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): VotingParams { - const message = { ...baseVotingParams } as VotingParams; - if (object.voting_period !== undefined && object.voting_period !== null) { - message.voting_period = Duration.fromPartial(object.voting_period); - } else { - message.voting_period = undefined; - } - return message; - }, -}; - -const baseTallyParams: object = {}; - -export const TallyParams = { - encode(message: TallyParams, writer: Writer = Writer.create()): Writer { - if (message.quorum.length !== 0) { - writer.uint32(10).bytes(message.quorum); - } - if (message.threshold.length !== 0) { - writer.uint32(18).bytes(message.threshold); - } - if (message.veto_threshold.length !== 0) { - writer.uint32(26).bytes(message.veto_threshold); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TallyParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTallyParams } as TallyParams; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quorum = reader.bytes(); - break; - case 2: - message.threshold = reader.bytes(); - break; - case 3: - message.veto_threshold = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TallyParams { - const message = { ...baseTallyParams } as TallyParams; - if (object.quorum !== undefined && object.quorum !== null) { - message.quorum = bytesFromBase64(object.quorum); - } - if (object.threshold !== undefined && object.threshold !== null) { - message.threshold = bytesFromBase64(object.threshold); - } - if (object.veto_threshold !== undefined && object.veto_threshold !== null) { - message.veto_threshold = bytesFromBase64(object.veto_threshold); - } - return message; - }, - - toJSON(message: TallyParams): unknown { - const obj: any = {}; - message.quorum !== undefined && - (obj.quorum = base64FromBytes( - message.quorum !== undefined ? message.quorum : new Uint8Array() - )); - message.threshold !== undefined && - (obj.threshold = base64FromBytes( - message.threshold !== undefined ? message.threshold : new Uint8Array() - )); - message.veto_threshold !== undefined && - (obj.veto_threshold = base64FromBytes( - message.veto_threshold !== undefined - ? message.veto_threshold - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): TallyParams { - const message = { ...baseTallyParams } as TallyParams; - if (object.quorum !== undefined && object.quorum !== null) { - message.quorum = object.quorum; - } else { - message.quorum = new Uint8Array(); - } - if (object.threshold !== undefined && object.threshold !== null) { - message.threshold = object.threshold; - } else { - message.threshold = new Uint8Array(); - } - if (object.veto_threshold !== undefined && object.veto_threshold !== null) { - message.veto_threshold = object.veto_threshold; - } else { - message.veto_threshold = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/query.ts deleted file mode 100644 index a00320a2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/query.ts +++ /dev/null @@ -1,1548 +0,0 @@ -/* eslint-disable */ -import { - ProposalStatus, - Proposal, - Vote, - VotingParams, - DepositParams, - TallyParams, - Deposit, - TallyResult, - proposalStatusFromJSON, - proposalStatusToJSON, -} from "../../../cosmos/gov/v1beta1/gov"; -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; - -export const protobufPackage = "cosmos.gov.v1beta1"; - -/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ -export interface QueryProposalRequest { - /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; -} - -/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ -export interface QueryProposalResponse { - proposal: Proposal | undefined; -} - -/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ -export interface QueryProposalsRequest { - /** proposal_status defines the status of the proposals. */ - proposal_status: ProposalStatus; - /** voter defines the voter address for the proposals. */ - voter: string; - /** depositor defines the deposit addresses from the proposals. */ - depositor: string; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryProposalsResponse is the response type for the Query/Proposals RPC - * method. - */ -export interface QueryProposalsResponse { - proposals: Proposal[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ -export interface QueryVoteRequest { - /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; - /** voter defines the oter address for the proposals. */ - voter: string; -} - -/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ -export interface QueryVoteResponse { - /** vote defined the queried vote. */ - vote: Vote | undefined; -} - -/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ -export interface QueryVotesRequest { - /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ -export interface QueryVotesResponse { - /** votes defined the queried votes. */ - votes: Vote[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { - /** - * params_type defines which parameters to query for, can be one of "voting", - * "tallying" or "deposit". - */ - params_type: string; -} - -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponse { - /** voting_params defines the parameters related to voting. */ - voting_params: VotingParams | undefined; - /** deposit_params defines the parameters related to deposit. */ - deposit_params: DepositParams | undefined; - /** tally_params defines the parameters related to tally. */ - tally_params: TallyParams | undefined; -} - -/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ -export interface QueryDepositRequest { - /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; - /** depositor defines the deposit addresses from the proposals. */ - depositor: string; -} - -/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ -export interface QueryDepositResponse { - /** deposit defines the requested deposit. */ - deposit: Deposit | undefined; -} - -/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ -export interface QueryDepositsRequest { - /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ -export interface QueryDepositsResponse { - deposits: Deposit[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ -export interface QueryTallyResultRequest { - /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; -} - -/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ -export interface QueryTallyResultResponse { - /** tally defines the requested tally. */ - tally: TallyResult | undefined; -} - -const baseQueryProposalRequest: object = { proposal_id: 0 }; - -export const QueryProposalRequest = { - encode( - message: QueryProposalRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryProposalRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryProposalRequest } as QueryProposalRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProposalRequest { - const message = { ...baseQueryProposalRequest } as QueryProposalRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - return message; - }, - - toJSON(message: QueryProposalRequest): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - return obj; - }, - - fromPartial(object: DeepPartial): QueryProposalRequest { - const message = { ...baseQueryProposalRequest } as QueryProposalRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - return message; - }, -}; - -const baseQueryProposalResponse: object = {}; - -export const QueryProposalResponse = { - encode( - message: QueryProposalResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal !== undefined) { - Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryProposalResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryProposalResponse } as QueryProposalResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal = Proposal.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProposalResponse { - const message = { ...baseQueryProposalResponse } as QueryProposalResponse; - if (object.proposal !== undefined && object.proposal !== null) { - message.proposal = Proposal.fromJSON(object.proposal); - } else { - message.proposal = undefined; - } - return message; - }, - - toJSON(message: QueryProposalResponse): unknown { - const obj: any = {}; - message.proposal !== undefined && - (obj.proposal = message.proposal - ? Proposal.toJSON(message.proposal) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryProposalResponse { - const message = { ...baseQueryProposalResponse } as QueryProposalResponse; - if (object.proposal !== undefined && object.proposal !== null) { - message.proposal = Proposal.fromPartial(object.proposal); - } else { - message.proposal = undefined; - } - return message; - }, -}; - -const baseQueryProposalsRequest: object = { - proposal_status: 0, - voter: "", - depositor: "", -}; - -export const QueryProposalsRequest = { - encode( - message: QueryProposalsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_status !== 0) { - writer.uint32(8).int32(message.proposal_status); - } - if (message.voter !== "") { - writer.uint32(18).string(message.voter); - } - if (message.depositor !== "") { - writer.uint32(26).string(message.depositor); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryProposalsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryProposalsRequest } as QueryProposalsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_status = reader.int32() as any; - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.depositor = reader.string(); - break; - case 4: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryProposalsRequest { - const message = { ...baseQueryProposalsRequest } as QueryProposalsRequest; - if ( - object.proposal_status !== undefined && - object.proposal_status !== null - ) { - message.proposal_status = proposalStatusFromJSON(object.proposal_status); - } else { - message.proposal_status = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryProposalsRequest): unknown { - const obj: any = {}; - message.proposal_status !== undefined && - (obj.proposal_status = proposalStatusToJSON(message.proposal_status)); - message.voter !== undefined && (obj.voter = message.voter); - message.depositor !== undefined && (obj.depositor = message.depositor); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryProposalsRequest { - const message = { ...baseQueryProposalsRequest } as QueryProposalsRequest; - if ( - object.proposal_status !== undefined && - object.proposal_status !== null - ) { - message.proposal_status = object.proposal_status; - } else { - message.proposal_status = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryProposalsResponse: object = {}; - -export const QueryProposalsResponse = { - encode( - message: QueryProposalsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.proposals) { - Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryProposalsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryProposalsResponse } as QueryProposalsResponse; - message.proposals = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposals.push(Proposal.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): QueryProposalsResponse { - const message = { ...baseQueryProposalsResponse } as QueryProposalsResponse; - message.proposals = []; - if (object.proposals !== undefined && object.proposals !== null) { - for (const e of object.proposals) { - message.proposals.push(Proposal.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryProposalsResponse): unknown { - const obj: any = {}; - if (message.proposals) { - obj.proposals = message.proposals.map((e) => - e ? Proposal.toJSON(e) : undefined - ); - } else { - obj.proposals = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryProposalsResponse { - const message = { ...baseQueryProposalsResponse } as QueryProposalsResponse; - message.proposals = []; - if (object.proposals !== undefined && object.proposals !== null) { - for (const e of object.proposals) { - message.proposals.push(Proposal.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryVoteRequest: object = { proposal_id: 0, voter: "" }; - -export const QueryVoteRequest = { - encode(message: QueryVoteRequest, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.voter !== "") { - writer.uint32(18).string(message.voter); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryVoteRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryVoteRequest } as QueryVoteRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.voter = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryVoteRequest { - const message = { ...baseQueryVoteRequest } as QueryVoteRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - return message; - }, - - toJSON(message: QueryVoteRequest): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.voter !== undefined && (obj.voter = message.voter); - return obj; - }, - - fromPartial(object: DeepPartial): QueryVoteRequest { - const message = { ...baseQueryVoteRequest } as QueryVoteRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } - return message; - }, -}; - -const baseQueryVoteResponse: object = {}; - -export const QueryVoteResponse = { - encode(message: QueryVoteResponse, writer: Writer = Writer.create()): Writer { - if (message.vote !== undefined) { - Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryVoteResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryVoteResponse } as QueryVoteResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.vote = Vote.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryVoteResponse { - const message = { ...baseQueryVoteResponse } as QueryVoteResponse; - if (object.vote !== undefined && object.vote !== null) { - message.vote = Vote.fromJSON(object.vote); - } else { - message.vote = undefined; - } - return message; - }, - - toJSON(message: QueryVoteResponse): unknown { - const obj: any = {}; - message.vote !== undefined && - (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryVoteResponse { - const message = { ...baseQueryVoteResponse } as QueryVoteResponse; - if (object.vote !== undefined && object.vote !== null) { - message.vote = Vote.fromPartial(object.vote); - } else { - message.vote = undefined; - } - return message; - }, -}; - -const baseQueryVotesRequest: object = { proposal_id: 0 }; - -export const QueryVotesRequest = { - encode(message: QueryVotesRequest, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryVotesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryVotesRequest } as QueryVotesRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryVotesRequest { - const message = { ...baseQueryVotesRequest } as QueryVotesRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryVotesRequest): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryVotesRequest { - const message = { ...baseQueryVotesRequest } as QueryVotesRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryVotesResponse: object = {}; - -export const QueryVotesResponse = { - encode( - message: QueryVotesResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.votes) { - Vote.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryVotesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryVotesResponse } as QueryVotesResponse; - message.votes = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.votes.push(Vote.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): QueryVotesResponse { - const message = { ...baseQueryVotesResponse } as QueryVotesResponse; - message.votes = []; - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(Vote.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryVotesResponse): unknown { - const obj: any = {}; - if (message.votes) { - obj.votes = message.votes.map((e) => (e ? Vote.toJSON(e) : undefined)); - } else { - obj.votes = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryVotesResponse { - const message = { ...baseQueryVotesResponse } as QueryVotesResponse; - message.votes = []; - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(Vote.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryParamsRequest: object = { params_type: "" }; - -export const QueryParamsRequest = { - encode( - message: QueryParamsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.params_type !== "") { - writer.uint32(10).string(message.params_type); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params_type = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - if (object.params_type !== undefined && object.params_type !== null) { - message.params_type = String(object.params_type); - } else { - message.params_type = ""; - } - return message; - }, - - toJSON(message: QueryParamsRequest): unknown { - const obj: any = {}; - message.params_type !== undefined && - (obj.params_type = message.params_type); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - if (object.params_type !== undefined && object.params_type !== null) { - message.params_type = object.params_type; - } else { - message.params_type = ""; - } - return message; - }, -}; - -const baseQueryParamsResponse: object = {}; - -export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.voting_params !== undefined) { - VotingParams.encode( - message.voting_params, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.deposit_params !== undefined) { - DepositParams.encode( - message.deposit_params, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.tally_params !== undefined) { - TallyParams.encode( - message.tally_params, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.voting_params = VotingParams.decode(reader, reader.uint32()); - break; - case 2: - message.deposit_params = DepositParams.decode( - reader, - reader.uint32() - ); - break; - case 3: - message.tally_params = TallyParams.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.voting_params !== undefined && object.voting_params !== null) { - message.voting_params = VotingParams.fromJSON(object.voting_params); - } else { - message.voting_params = undefined; - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.deposit_params = DepositParams.fromJSON(object.deposit_params); - } else { - message.deposit_params = undefined; - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tally_params = TallyParams.fromJSON(object.tally_params); - } else { - message.tally_params = undefined; - } - return message; - }, - - toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.voting_params !== undefined && - (obj.voting_params = message.voting_params - ? VotingParams.toJSON(message.voting_params) - : undefined); - message.deposit_params !== undefined && - (obj.deposit_params = message.deposit_params - ? DepositParams.toJSON(message.deposit_params) - : undefined); - message.tally_params !== undefined && - (obj.tally_params = message.tally_params - ? TallyParams.toJSON(message.tally_params) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.voting_params !== undefined && object.voting_params !== null) { - message.voting_params = VotingParams.fromPartial(object.voting_params); - } else { - message.voting_params = undefined; - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.deposit_params = DepositParams.fromPartial(object.deposit_params); - } else { - message.deposit_params = undefined; - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tally_params = TallyParams.fromPartial(object.tally_params); - } else { - message.tally_params = undefined; - } - return message; - }, -}; - -const baseQueryDepositRequest: object = { proposal_id: 0, depositor: "" }; - -export const QueryDepositRequest = { - encode( - message: QueryDepositRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.depositor !== "") { - writer.uint32(18).string(message.depositor); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryDepositRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDepositRequest } as QueryDepositRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.depositor = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDepositRequest { - const message = { ...baseQueryDepositRequest } as QueryDepositRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - return message; - }, - - toJSON(message: QueryDepositRequest): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.depositor !== undefined && (obj.depositor = message.depositor); - return obj; - }, - - fromPartial(object: DeepPartial): QueryDepositRequest { - const message = { ...baseQueryDepositRequest } as QueryDepositRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; - } - return message; - }, -}; - -const baseQueryDepositResponse: object = {}; - -export const QueryDepositResponse = { - encode( - message: QueryDepositResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.deposit !== undefined) { - Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryDepositResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDepositResponse } as QueryDepositResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deposit = Deposit.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDepositResponse { - const message = { ...baseQueryDepositResponse } as QueryDepositResponse; - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = Deposit.fromJSON(object.deposit); - } else { - message.deposit = undefined; - } - return message; - }, - - toJSON(message: QueryDepositResponse): unknown { - const obj: any = {}; - message.deposit !== undefined && - (obj.deposit = message.deposit - ? Deposit.toJSON(message.deposit) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryDepositResponse { - const message = { ...baseQueryDepositResponse } as QueryDepositResponse; - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = Deposit.fromPartial(object.deposit); - } else { - message.deposit = undefined; - } - return message; - }, -}; - -const baseQueryDepositsRequest: object = { proposal_id: 0 }; - -export const QueryDepositsRequest = { - encode( - message: QueryDepositsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryDepositsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDepositsRequest } as QueryDepositsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDepositsRequest { - const message = { ...baseQueryDepositsRequest } as QueryDepositsRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDepositsRequest): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryDepositsRequest { - const message = { ...baseQueryDepositsRequest } as QueryDepositsRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDepositsResponse: object = {}; - -export const QueryDepositsResponse = { - encode( - message: QueryDepositsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.deposits) { - Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryDepositsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDepositsResponse } as QueryDepositsResponse; - message.deposits = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deposits.push(Deposit.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): QueryDepositsResponse { - const message = { ...baseQueryDepositsResponse } as QueryDepositsResponse; - message.deposits = []; - if (object.deposits !== undefined && object.deposits !== null) { - for (const e of object.deposits) { - message.deposits.push(Deposit.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDepositsResponse): unknown { - const obj: any = {}; - if (message.deposits) { - obj.deposits = message.deposits.map((e) => - e ? Deposit.toJSON(e) : undefined - ); - } else { - obj.deposits = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDepositsResponse { - const message = { ...baseQueryDepositsResponse } as QueryDepositsResponse; - message.deposits = []; - if (object.deposits !== undefined && object.deposits !== null) { - for (const e of object.deposits) { - message.deposits.push(Deposit.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryTallyResultRequest: object = { proposal_id: 0 }; - -export const QueryTallyResultRequest = { - encode( - message: QueryTallyResultRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryTallyResultRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryTallyResultRequest, - } as QueryTallyResultRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryTallyResultRequest { - const message = { - ...baseQueryTallyResultRequest, - } as QueryTallyResultRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - return message; - }, - - toJSON(message: QueryTallyResultRequest): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryTallyResultRequest { - const message = { - ...baseQueryTallyResultRequest, - } as QueryTallyResultRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - return message; - }, -}; - -const baseQueryTallyResultResponse: object = {}; - -export const QueryTallyResultResponse = { - encode( - message: QueryTallyResultResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.tally !== undefined) { - TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryTallyResultResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryTallyResultResponse, - } as QueryTallyResultResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tally = TallyResult.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryTallyResultResponse { - const message = { - ...baseQueryTallyResultResponse, - } as QueryTallyResultResponse; - if (object.tally !== undefined && object.tally !== null) { - message.tally = TallyResult.fromJSON(object.tally); - } else { - message.tally = undefined; - } - return message; - }, - - toJSON(message: QueryTallyResultResponse): unknown { - const obj: any = {}; - message.tally !== undefined && - (obj.tally = message.tally - ? TallyResult.toJSON(message.tally) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryTallyResultResponse { - const message = { - ...baseQueryTallyResultResponse, - } as QueryTallyResultResponse; - if (object.tally !== undefined && object.tally !== null) { - message.tally = TallyResult.fromPartial(object.tally); - } else { - message.tally = undefined; - } - return message; - }, -}; - -/** Query defines the gRPC querier service for gov module */ -export interface Query { - /** Proposal queries proposal details based on ProposalID. */ - Proposal(request: QueryProposalRequest): Promise; - /** Proposals queries all proposals based on given status. */ - Proposals(request: QueryProposalsRequest): Promise; - /** Vote queries voted information based on proposalID, voterAddr. */ - Vote(request: QueryVoteRequest): Promise; - /** Votes queries votes of a given proposal. */ - Votes(request: QueryVotesRequest): Promise; - /** Params queries all parameters of the gov module. */ - Params(request: QueryParamsRequest): Promise; - /** Deposit queries single deposit information based proposalID, depositAddr. */ - Deposit(request: QueryDepositRequest): Promise; - /** Deposits queries all deposits of a single proposal. */ - Deposits(request: QueryDepositsRequest): Promise; - /** TallyResult queries the tally of a proposal vote. */ - TallyResult( - request: QueryTallyResultRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Proposal(request: QueryProposalRequest): Promise { - const data = QueryProposalRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Proposal", - data - ); - return promise.then((data) => - QueryProposalResponse.decode(new Reader(data)) - ); - } - - Proposals(request: QueryProposalsRequest): Promise { - const data = QueryProposalsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Proposals", - data - ); - return promise.then((data) => - QueryProposalsResponse.decode(new Reader(data)) - ); - } - - Vote(request: QueryVoteRequest): Promise { - const data = QueryVoteRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Vote", data); - return promise.then((data) => QueryVoteResponse.decode(new Reader(data))); - } - - Votes(request: QueryVotesRequest): Promise { - const data = QueryVotesRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Votes", data); - return promise.then((data) => QueryVotesResponse.decode(new Reader(data))); - } - - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } - - Deposit(request: QueryDepositRequest): Promise { - const data = QueryDepositRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Deposit", - data - ); - return promise.then((data) => - QueryDepositResponse.decode(new Reader(data)) - ); - } - - Deposits(request: QueryDepositsRequest): Promise { - const data = QueryDepositsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Deposits", - data - ); - return promise.then((data) => - QueryDepositsResponse.decode(new Reader(data)) - ); - } - - TallyResult( - request: QueryTallyResultRequest - ): Promise { - const data = QueryTallyResultRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "TallyResult", - data - ); - return promise.then((data) => - QueryTallyResultResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/tx.ts deleted file mode 100644 index 8f79b2a1..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos/gov/v1beta1/tx.ts +++ /dev/null @@ -1,755 +0,0 @@ -/* eslint-disable */ -import { - VoteOption, - WeightedVoteOption, - voteOptionFromJSON, - voteOptionToJSON, -} from "../../../cosmos/gov/v1beta1/gov"; -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { Any } from "../../../google/protobuf/any"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmos.gov.v1beta1"; - -/** - * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary - * proposal Content. - */ -export interface MsgSubmitProposal { - content: Any | undefined; - initial_deposit: Coin[]; - proposer: string; -} - -/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ -export interface MsgSubmitProposalResponse { - proposal_id: number; -} - -/** MsgVote defines a message to cast a vote. */ -export interface MsgVote { - proposal_id: number; - voter: string; - option: VoteOption; -} - -/** MsgVoteResponse defines the Msg/Vote response type. */ -export interface MsgVoteResponse {} - -/** - * MsgVoteWeighted defines a message to cast a vote. - * - * Since: cosmos-sdk 0.43 - */ -export interface MsgVoteWeighted { - proposal_id: number; - voter: string; - options: WeightedVoteOption[]; -} - -/** - * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. - * - * Since: cosmos-sdk 0.43 - */ -export interface MsgVoteWeightedResponse {} - -/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ -export interface MsgDeposit { - proposal_id: number; - depositor: string; - amount: Coin[]; -} - -/** MsgDepositResponse defines the Msg/Deposit response type. */ -export interface MsgDepositResponse {} - -const baseMsgSubmitProposal: object = { proposer: "" }; - -export const MsgSubmitProposal = { - encode(message: MsgSubmitProposal, writer: Writer = Writer.create()): Writer { - if (message.content !== undefined) { - Any.encode(message.content, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.initial_deposit) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.proposer !== "") { - writer.uint32(26).string(message.proposer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgSubmitProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSubmitProposal } as MsgSubmitProposal; - message.initial_deposit = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.content = Any.decode(reader, reader.uint32()); - break; - case 2: - message.initial_deposit.push(Coin.decode(reader, reader.uint32())); - break; - case 3: - message.proposer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSubmitProposal { - const message = { ...baseMsgSubmitProposal } as MsgSubmitProposal; - message.initial_deposit = []; - if (object.content !== undefined && object.content !== null) { - message.content = Any.fromJSON(object.content); - } else { - message.content = undefined; - } - if ( - object.initial_deposit !== undefined && - object.initial_deposit !== null - ) { - for (const e of object.initial_deposit) { - message.initial_deposit.push(Coin.fromJSON(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = String(object.proposer); - } else { - message.proposer = ""; - } - return message; - }, - - toJSON(message: MsgSubmitProposal): unknown { - const obj: any = {}; - message.content !== undefined && - (obj.content = message.content ? Any.toJSON(message.content) : undefined); - if (message.initial_deposit) { - obj.initial_deposit = message.initial_deposit.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.initial_deposit = []; - } - message.proposer !== undefined && (obj.proposer = message.proposer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgSubmitProposal { - const message = { ...baseMsgSubmitProposal } as MsgSubmitProposal; - message.initial_deposit = []; - if (object.content !== undefined && object.content !== null) { - message.content = Any.fromPartial(object.content); - } else { - message.content = undefined; - } - if ( - object.initial_deposit !== undefined && - object.initial_deposit !== null - ) { - for (const e of object.initial_deposit) { - message.initial_deposit.push(Coin.fromPartial(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = object.proposer; - } else { - message.proposer = ""; - } - return message; - }, -}; - -const baseMsgSubmitProposalResponse: object = { proposal_id: 0 }; - -export const MsgSubmitProposalResponse = { - encode( - message: MsgSubmitProposalResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgSubmitProposalResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgSubmitProposalResponse, - } as MsgSubmitProposalResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSubmitProposalResponse { - const message = { - ...baseMsgSubmitProposalResponse, - } as MsgSubmitProposalResponse; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - return message; - }, - - toJSON(message: MsgSubmitProposalResponse): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgSubmitProposalResponse { - const message = { - ...baseMsgSubmitProposalResponse, - } as MsgSubmitProposalResponse; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - return message; - }, -}; - -const baseMsgVote: object = { proposal_id: 0, voter: "", option: 0 }; - -export const MsgVote = { - encode(message: MsgVote, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.voter !== "") { - writer.uint32(18).string(message.voter); - } - if (message.option !== 0) { - writer.uint32(24).int32(message.option); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgVote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgVote } as MsgVote; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.option = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgVote { - const message = { ...baseMsgVote } as MsgVote; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - if (object.option !== undefined && object.option !== null) { - message.option = voteOptionFromJSON(object.option); - } else { - message.option = 0; - } - return message; - }, - - toJSON(message: MsgVote): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.voter !== undefined && (obj.voter = message.voter); - message.option !== undefined && - (obj.option = voteOptionToJSON(message.option)); - return obj; - }, - - fromPartial(object: DeepPartial): MsgVote { - const message = { ...baseMsgVote } as MsgVote; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } else { - message.option = 0; - } - return message; - }, -}; - -const baseMsgVoteResponse: object = {}; - -export const MsgVoteResponse = { - encode(_: MsgVoteResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgVoteResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgVoteResponse } as MsgVoteResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgVoteResponse { - const message = { ...baseMsgVoteResponse } as MsgVoteResponse; - return message; - }, - - toJSON(_: MsgVoteResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgVoteResponse { - const message = { ...baseMsgVoteResponse } as MsgVoteResponse; - return message; - }, -}; - -const baseMsgVoteWeighted: object = { proposal_id: 0, voter: "" }; - -export const MsgVoteWeighted = { - encode(message: MsgVoteWeighted, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.voter !== "") { - writer.uint32(18).string(message.voter); - } - for (const v of message.options) { - WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgVoteWeighted { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgVoteWeighted } as MsgVoteWeighted; - message.options = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.options.push( - WeightedVoteOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgVoteWeighted { - const message = { ...baseMsgVoteWeighted } as MsgVoteWeighted; - message.options = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - if (object.options !== undefined && object.options !== null) { - for (const e of object.options) { - message.options.push(WeightedVoteOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MsgVoteWeighted): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.voter !== undefined && (obj.voter = message.voter); - if (message.options) { - obj.options = message.options.map((e) => - e ? WeightedVoteOption.toJSON(e) : undefined - ); - } else { - obj.options = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MsgVoteWeighted { - const message = { ...baseMsgVoteWeighted } as MsgVoteWeighted; - message.options = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } - if (object.options !== undefined && object.options !== null) { - for (const e of object.options) { - message.options.push(WeightedVoteOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMsgVoteWeightedResponse: object = {}; - -export const MsgVoteWeightedResponse = { - encode(_: MsgVoteWeightedResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgVoteWeightedResponse, - } as MsgVoteWeightedResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgVoteWeightedResponse { - const message = { - ...baseMsgVoteWeightedResponse, - } as MsgVoteWeightedResponse; - return message; - }, - - toJSON(_: MsgVoteWeightedResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgVoteWeightedResponse { - const message = { - ...baseMsgVoteWeightedResponse, - } as MsgVoteWeightedResponse; - return message; - }, -}; - -const baseMsgDeposit: object = { proposal_id: 0, depositor: "" }; - -export const MsgDeposit = { - encode(message: MsgDeposit, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); - } - if (message.depositor !== "") { - writer.uint32(18).string(message.depositor); - } - for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgDeposit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgDeposit } as MsgDeposit; - message.amount = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.depositor = reader.string(); - break; - case 3: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDeposit { - const message = { ...baseMsgDeposit } as MsgDeposit; - message.amount = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MsgDeposit): unknown { - const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.depositor !== undefined && (obj.depositor = message.depositor); - if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.amount = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MsgDeposit { - const message = { ...baseMsgDeposit } as MsgDeposit; - message.amount = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMsgDepositResponse: object = {}; - -export const MsgDepositResponse = { - encode(_: MsgDepositResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgDepositResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgDepositResponse } as MsgDepositResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDepositResponse { - const message = { ...baseMsgDepositResponse } as MsgDepositResponse; - return message; - }, - - toJSON(_: MsgDepositResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgDepositResponse { - const message = { ...baseMsgDepositResponse } as MsgDepositResponse; - return message; - }, -}; - -/** Msg defines the bank Msg service. */ -export interface Msg { - /** SubmitProposal defines a method to create new proposal given a content. */ - SubmitProposal( - request: MsgSubmitProposal - ): Promise; - /** Vote defines a method to add a vote on a specific proposal. */ - Vote(request: MsgVote): Promise; - /** - * VoteWeighted defines a method to add a weighted vote on a specific proposal. - * - * Since: cosmos-sdk 0.43 - */ - VoteWeighted(request: MsgVoteWeighted): Promise; - /** Deposit defines a method to add deposit on a specific proposal. */ - Deposit(request: MsgDeposit): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - SubmitProposal( - request: MsgSubmitProposal - ): Promise { - const data = MsgSubmitProposal.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Msg", - "SubmitProposal", - data - ); - return promise.then((data) => - MsgSubmitProposalResponse.decode(new Reader(data)) - ); - } - - Vote(request: MsgVote): Promise { - const data = MsgVote.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Vote", data); - return promise.then((data) => MsgVoteResponse.decode(new Reader(data))); - } - - VoteWeighted(request: MsgVoteWeighted): Promise { - const data = MsgVoteWeighted.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Msg", - "VoteWeighted", - data - ); - return promise.then((data) => - MsgVoteWeightedResponse.decode(new Reader(data)) - ); - } - - Deposit(request: MsgDeposit): Promise { - const data = MsgDeposit.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Deposit", data); - return promise.then((data) => MsgDepositResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos_proto/cosmos.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos_proto/cosmos.ts deleted file mode 100644 index 9ec67a12..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/cosmos_proto/cosmos.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "cosmos_proto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/duration.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/duration.ts deleted file mode 100644 index fffd5b14..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/duration.ts +++ /dev/null @@ -1,188 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - */ -export interface Duration { - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ - seconds: number; - /** - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - */ - nanos: number; -} - -const baseDuration: object = { seconds: 0, nanos: 0 }; - -export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDuration } as Duration; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Duration): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/package.json deleted file mode 100644 index 12825ad9..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-gov-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.gov.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/gov/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.gov.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/index.ts deleted file mode 100644 index 100a9cd5..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/index.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { Minter } from "./module/types/cosmos/mint/v1beta1/mint" -import { Params } from "./module/types/cosmos/mint/v1beta1/mint" - - -export { Minter, Params }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Params: {}, - Inflation: {}, - AnnualProvisions: {}, - - _Structure: { - Minter: getStructure(Minter.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getInflation: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Inflation[JSON.stringify(params)] ?? {} - }, - getAnnualProvisions: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AnnualProvisions[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.mint.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryInflation({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryInflation()).data - - - commit('QUERY', { query: 'Inflation', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryInflation', payload: { options: { all }, params: {...key},query }}) - return getters['getInflation']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryInflation API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAnnualProvisions({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryAnnualProvisions()).data - - - commit('QUERY', { query: 'AnnualProvisions', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAnnualProvisions', payload: { options: { all }, params: {...key},query }}) - return getters['getAnnualProvisions']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAnnualProvisions API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/rest.ts deleted file mode 100644 index c8cf02bf..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/rest.ts +++ /dev/null @@ -1,312 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface ProtobufAny { - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** - * Params holds parameters for the mint module. - */ -export interface V1Beta1Params { - mint_denom?: string; - inflation_rate_change?: string; - inflation_max?: string; - inflation_min?: string; - goal_bonded?: string; - - /** @format uint64 */ - blocks_per_year?: string; -} - -/** -* QueryAnnualProvisionsResponse is the response type for the -Query/AnnualProvisions RPC method. -*/ -export interface V1Beta1QueryAnnualProvisionsResponse { - /** - * annual_provisions is the current minting annual provisions value. - * @format byte - */ - annual_provisions?: string; -} - -/** -* QueryInflationResponse is the response type for the Query/Inflation RPC -method. -*/ -export interface V1Beta1QueryInflationResponse { - /** - * inflation is the current minting inflation value. - * @format byte - */ - inflation?: string; -} - -/** - * QueryParamsResponse is the response type for the Query/Params RPC method. - */ -export interface V1Beta1QueryParamsResponse { - /** params defines the parameters of the module. */ - params?: V1Beta1Params; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/mint/v1beta1/genesis.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryAnnualProvisions - * @summary AnnualProvisions current minting annual provisions value. - * @request GET:/cosmos/mint/v1beta1/annual_provisions - */ - queryAnnualProvisions = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/mint/v1beta1/annual_provisions`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryInflation - * @summary Inflation returns the current minting inflation value. - * @request GET:/cosmos/mint/v1beta1/inflation - */ - queryInflation = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/mint/v1beta1/inflation`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryParams - * @summary Params returns the total set of minting parameters. - * @request GET:/cosmos/mint/v1beta1/params - */ - queryParams = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/mint/v1beta1/params`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/cosmos/mint/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/cosmos/mint/v1beta1/genesis.ts deleted file mode 100644 index 779cb180..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/cosmos/mint/v1beta1/genesis.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* eslint-disable */ -import { Minter, Params } from "../../../cosmos/mint/v1beta1/mint"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.mint.v1beta1"; - -/** GenesisState defines the mint module's genesis state. */ -export interface GenesisState { - /** minter is a space for holding current inflation information. */ - minter: Minter | undefined; - /** params defines all the paramaters of the module. */ - params: Params | undefined; -} - -const baseGenesisState: object = {}; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.minter !== undefined) { - Minter.encode(message.minter, writer.uint32(10).fork()).ldelim(); - } - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.minter = Minter.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 { - const message = { ...baseGenesisState } as GenesisState; - if (object.minter !== undefined && object.minter !== null) { - message.minter = Minter.fromJSON(object.minter); - } else { - message.minter = undefined; - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.minter !== undefined && - (obj.minter = message.minter ? Minter.toJSON(message.minter) : undefined); - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - if (object.minter !== undefined && object.minter !== null) { - message.minter = Minter.fromPartial(object.minter); - } else { - message.minter = undefined; - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/cosmos/mint/v1beta1/mint.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/cosmos/mint/v1beta1/mint.ts deleted file mode 100644 index 3c0919e8..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/cosmos/mint/v1beta1/mint.ts +++ /dev/null @@ -1,305 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.mint.v1beta1"; - -/** Minter represents the minting state. */ -export interface Minter { - /** current annual inflation rate */ - inflation: string; - /** current annual expected provisions */ - annual_provisions: string; -} - -/** Params holds parameters for the mint module. */ -export interface Params { - /** type of coin to mint */ - mint_denom: string; - /** maximum annual change in inflation rate */ - inflation_rate_change: string; - /** maximum inflation rate */ - inflation_max: string; - /** minimum inflation rate */ - inflation_min: string; - /** goal of percent bonded atoms */ - goal_bonded: string; - /** expected blocks per year */ - blocks_per_year: number; -} - -const baseMinter: object = { inflation: "", annual_provisions: "" }; - -export const Minter = { - encode(message: Minter, writer: Writer = Writer.create()): Writer { - if (message.inflation !== "") { - writer.uint32(10).string(message.inflation); - } - if (message.annual_provisions !== "") { - writer.uint32(18).string(message.annual_provisions); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Minter { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMinter } as Minter; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.inflation = reader.string(); - break; - case 2: - message.annual_provisions = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Minter { - const message = { ...baseMinter } as Minter; - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = String(object.inflation); - } else { - message.inflation = ""; - } - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annual_provisions = String(object.annual_provisions); - } else { - message.annual_provisions = ""; - } - return message; - }, - - toJSON(message: Minter): unknown { - const obj: any = {}; - message.inflation !== undefined && (obj.inflation = message.inflation); - message.annual_provisions !== undefined && - (obj.annual_provisions = message.annual_provisions); - return obj; - }, - - fromPartial(object: DeepPartial): Minter { - const message = { ...baseMinter } as Minter; - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = object.inflation; - } else { - message.inflation = ""; - } - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annual_provisions = object.annual_provisions; - } else { - message.annual_provisions = ""; - } - return message; - }, -}; - -const baseParams: object = { - mint_denom: "", - inflation_rate_change: "", - inflation_max: "", - inflation_min: "", - goal_bonded: "", - blocks_per_year: 0, -}; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.mint_denom !== "") { - writer.uint32(10).string(message.mint_denom); - } - if (message.inflation_rate_change !== "") { - writer.uint32(18).string(message.inflation_rate_change); - } - if (message.inflation_max !== "") { - writer.uint32(26).string(message.inflation_max); - } - if (message.inflation_min !== "") { - writer.uint32(34).string(message.inflation_min); - } - if (message.goal_bonded !== "") { - writer.uint32(42).string(message.goal_bonded); - } - if (message.blocks_per_year !== 0) { - writer.uint32(48).uint64(message.blocks_per_year); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mint_denom = reader.string(); - break; - case 2: - message.inflation_rate_change = reader.string(); - break; - case 3: - message.inflation_max = reader.string(); - break; - case 4: - message.inflation_min = reader.string(); - break; - case 5: - message.goal_bonded = reader.string(); - break; - case 6: - message.blocks_per_year = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if (object.mint_denom !== undefined && object.mint_denom !== null) { - message.mint_denom = String(object.mint_denom); - } else { - message.mint_denom = ""; - } - if ( - object.inflation_rate_change !== undefined && - object.inflation_rate_change !== null - ) { - message.inflation_rate_change = String(object.inflation_rate_change); - } else { - message.inflation_rate_change = ""; - } - if (object.inflation_max !== undefined && object.inflation_max !== null) { - message.inflation_max = String(object.inflation_max); - } else { - message.inflation_max = ""; - } - if (object.inflation_min !== undefined && object.inflation_min !== null) { - message.inflation_min = String(object.inflation_min); - } else { - message.inflation_min = ""; - } - if (object.goal_bonded !== undefined && object.goal_bonded !== null) { - message.goal_bonded = String(object.goal_bonded); - } else { - message.goal_bonded = ""; - } - if ( - object.blocks_per_year !== undefined && - object.blocks_per_year !== null - ) { - message.blocks_per_year = Number(object.blocks_per_year); - } else { - message.blocks_per_year = 0; - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.mint_denom !== undefined && (obj.mint_denom = message.mint_denom); - message.inflation_rate_change !== undefined && - (obj.inflation_rate_change = message.inflation_rate_change); - message.inflation_max !== undefined && - (obj.inflation_max = message.inflation_max); - message.inflation_min !== undefined && - (obj.inflation_min = message.inflation_min); - message.goal_bonded !== undefined && - (obj.goal_bonded = message.goal_bonded); - message.blocks_per_year !== undefined && - (obj.blocks_per_year = message.blocks_per_year); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if (object.mint_denom !== undefined && object.mint_denom !== null) { - message.mint_denom = object.mint_denom; - } else { - message.mint_denom = ""; - } - if ( - object.inflation_rate_change !== undefined && - object.inflation_rate_change !== null - ) { - message.inflation_rate_change = object.inflation_rate_change; - } else { - message.inflation_rate_change = ""; - } - if (object.inflation_max !== undefined && object.inflation_max !== null) { - message.inflation_max = object.inflation_max; - } else { - message.inflation_max = ""; - } - if (object.inflation_min !== undefined && object.inflation_min !== null) { - message.inflation_min = object.inflation_min; - } else { - message.inflation_min = ""; - } - if (object.goal_bonded !== undefined && object.goal_bonded !== null) { - message.goal_bonded = object.goal_bonded; - } else { - message.goal_bonded = ""; - } - if ( - object.blocks_per_year !== undefined && - object.blocks_per_year !== null - ) { - message.blocks_per_year = object.blocks_per_year; - } else { - message.blocks_per_year = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/cosmos/mint/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/cosmos/mint/v1beta1/query.ts deleted file mode 100644 index 74ca3750..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/cosmos/mint/v1beta1/query.ts +++ /dev/null @@ -1,473 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Params } from "../../../cosmos/mint/v1beta1/mint"; - -export const protobufPackage = "cosmos.mint.v1beta1"; - -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} - -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponse { - /** params defines the parameters of the module. */ - params: Params | undefined; -} - -/** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ -export interface QueryInflationRequest {} - -/** - * QueryInflationResponse is the response type for the Query/Inflation RPC - * method. - */ -export interface QueryInflationResponse { - /** inflation is the current minting inflation value. */ - inflation: Uint8Array; -} - -/** - * QueryAnnualProvisionsRequest is the request type for the - * Query/AnnualProvisions RPC method. - */ -export interface QueryAnnualProvisionsRequest {} - -/** - * QueryAnnualProvisionsResponse is the response type for the - * Query/AnnualProvisions RPC method. - */ -export interface QueryAnnualProvisionsResponse { - /** annual_provisions is the current minting annual provisions value. */ - annual_provisions: Uint8Array; -} - -const baseQueryParamsRequest: object = {}; - -export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, - - toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, -}; - -const baseQueryParamsResponse: object = {}; - -export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - 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): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -const baseQueryInflationRequest: object = {}; - -export const QueryInflationRequest = { - encode(_: QueryInflationRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryInflationRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryInflationRequest } as QueryInflationRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryInflationRequest { - const message = { ...baseQueryInflationRequest } as QueryInflationRequest; - return message; - }, - - toJSON(_: QueryInflationRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryInflationRequest { - const message = { ...baseQueryInflationRequest } as QueryInflationRequest; - return message; - }, -}; - -const baseQueryInflationResponse: object = {}; - -export const QueryInflationResponse = { - encode( - message: QueryInflationResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.inflation.length !== 0) { - writer.uint32(10).bytes(message.inflation); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryInflationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryInflationResponse } as QueryInflationResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.inflation = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryInflationResponse { - const message = { ...baseQueryInflationResponse } as QueryInflationResponse; - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = bytesFromBase64(object.inflation); - } - return message; - }, - - toJSON(message: QueryInflationResponse): unknown { - const obj: any = {}; - message.inflation !== undefined && - (obj.inflation = base64FromBytes( - message.inflation !== undefined ? message.inflation : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryInflationResponse { - const message = { ...baseQueryInflationResponse } as QueryInflationResponse; - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = object.inflation; - } else { - message.inflation = new Uint8Array(); - } - return message; - }, -}; - -const baseQueryAnnualProvisionsRequest: object = {}; - -export const QueryAnnualProvisionsRequest = { - encode( - _: QueryAnnualProvisionsRequest, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAnnualProvisionsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAnnualProvisionsRequest, - } as QueryAnnualProvisionsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryAnnualProvisionsRequest { - const message = { - ...baseQueryAnnualProvisionsRequest, - } as QueryAnnualProvisionsRequest; - return message; - }, - - toJSON(_: QueryAnnualProvisionsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): QueryAnnualProvisionsRequest { - const message = { - ...baseQueryAnnualProvisionsRequest, - } as QueryAnnualProvisionsRequest; - return message; - }, -}; - -const baseQueryAnnualProvisionsResponse: object = {}; - -export const QueryAnnualProvisionsResponse = { - encode( - message: QueryAnnualProvisionsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.annual_provisions.length !== 0) { - writer.uint32(10).bytes(message.annual_provisions); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAnnualProvisionsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAnnualProvisionsResponse, - } as QueryAnnualProvisionsResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.annual_provisions = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAnnualProvisionsResponse { - const message = { - ...baseQueryAnnualProvisionsResponse, - } as QueryAnnualProvisionsResponse; - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annual_provisions = bytesFromBase64(object.annual_provisions); - } - return message; - }, - - toJSON(message: QueryAnnualProvisionsResponse): unknown { - const obj: any = {}; - message.annual_provisions !== undefined && - (obj.annual_provisions = base64FromBytes( - message.annual_provisions !== undefined - ? message.annual_provisions - : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAnnualProvisionsResponse { - const message = { - ...baseQueryAnnualProvisionsResponse, - } as QueryAnnualProvisionsResponse; - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annual_provisions = object.annual_provisions; - } else { - message.annual_provisions = new Uint8Array(); - } - return message; - }, -}; - -/** Query provides defines the gRPC querier service. */ -export interface Query { - /** Params returns the total set of minting parameters. */ - Params(request: QueryParamsRequest): Promise; - /** Inflation returns the current minting inflation value. */ - Inflation(request: QueryInflationRequest): Promise; - /** AnnualProvisions current minting annual provisions value. */ - AnnualProvisions( - request: QueryAnnualProvisionsRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.mint.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } - - Inflation(request: QueryInflationRequest): Promise { - const data = QueryInflationRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.mint.v1beta1.Query", - "Inflation", - data - ); - return promise.then((data) => - QueryInflationResponse.decode(new Reader(data)) - ); - } - - AnnualProvisions( - request: QueryAnnualProvisionsRequest - ): Promise { - const data = QueryAnnualProvisionsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.mint.v1beta1.Query", - "AnnualProvisions", - data - ); - return promise.then((data) => - QueryAnnualProvisionsResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/package.json deleted file mode 100644 index 90a325b9..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-mint-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.mint.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/mint/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.mint.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/index.ts deleted file mode 100644 index 6ad7fa6c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/index.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { ParameterChangeProposal } from "./module/types/cosmos/params/v1beta1/params" -import { ParamChange } from "./module/types/cosmos/params/v1beta1/params" - - -export { ParameterChangeProposal, ParamChange }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Params: {}, - - _Structure: { - ParameterChangeProposal: getStructure(ParameterChangeProposal.fromPartial({})), - ParamChange: getStructure(ParamChange.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.params.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryParams(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryParams({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/rest.ts deleted file mode 100644 index 88d657f7..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/rest.ts +++ /dev/null @@ -1,254 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface ProtobufAny { - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* ParamChange defines an individual parameter change, for use in -ParameterChangeProposal. -*/ -export interface V1Beta1ParamChange { - subspace?: string; - key?: string; - value?: string; -} - -/** - * QueryParamsResponse is response type for the Query/Params RPC method. - */ -export interface V1Beta1QueryParamsResponse { - /** param defines the queried parameter. */ - param?: V1Beta1ParamChange; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/params/v1beta1/params.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryParams - * @summary Params queries a specific parameter of a module, given its subspace and -key. - * @request GET:/cosmos/params/v1beta1/params - */ - queryParams = (query?: { subspace?: string; key?: string }, params: RequestParams = {}) => - this.request({ - path: `/cosmos/params/v1beta1/params`, - method: "GET", - query: query, - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/cosmos/params/v1beta1/params.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/cosmos/params/v1beta1/params.ts deleted file mode 100644 index 1aae5a59..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/cosmos/params/v1beta1/params.ts +++ /dev/null @@ -1,231 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.params.v1beta1"; - -/** ParameterChangeProposal defines a proposal to change one or more parameters. */ -export interface ParameterChangeProposal { - title: string; - description: string; - changes: ParamChange[]; -} - -/** - * ParamChange defines an individual parameter change, for use in - * ParameterChangeProposal. - */ -export interface ParamChange { - subspace: string; - key: string; - value: string; -} - -const baseParameterChangeProposal: object = { title: "", description: "" }; - -export const ParameterChangeProposal = { - encode( - message: ParameterChangeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - for (const v of message.changes) { - ParamChange.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ParameterChangeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseParameterChangeProposal, - } as ParameterChangeProposal; - message.changes = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.changes.push(ParamChange.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ParameterChangeProposal { - const message = { - ...baseParameterChangeProposal, - } as ParameterChangeProposal; - message.changes = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.changes !== undefined && object.changes !== null) { - for (const e of object.changes) { - message.changes.push(ParamChange.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ParameterChangeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - if (message.changes) { - obj.changes = message.changes.map((e) => - e ? ParamChange.toJSON(e) : undefined - ); - } else { - obj.changes = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ParameterChangeProposal { - const message = { - ...baseParameterChangeProposal, - } as ParameterChangeProposal; - message.changes = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.changes !== undefined && object.changes !== null) { - for (const e of object.changes) { - message.changes.push(ParamChange.fromPartial(e)); - } - } - return message; - }, -}; - -const baseParamChange: object = { subspace: "", key: "", value: "" }; - -export const ParamChange = { - encode(message: ParamChange, writer: Writer = Writer.create()): Writer { - if (message.subspace !== "") { - writer.uint32(10).string(message.subspace); - } - if (message.key !== "") { - writer.uint32(18).string(message.key); - } - if (message.value !== "") { - writer.uint32(26).string(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ParamChange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParamChange } as ParamChange; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subspace = reader.string(); - break; - case 2: - message.key = reader.string(); - break; - case 3: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ParamChange { - const message = { ...baseParamChange } as ParamChange; - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = String(object.subspace); - } else { - message.subspace = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = String(object.value); - } else { - message.value = ""; - } - return message; - }, - - toJSON(message: ParamChange): unknown { - const obj: any = {}; - message.subspace !== undefined && (obj.subspace = message.subspace); - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; - }, - - fromPartial(object: DeepPartial): ParamChange { - const message = { ...baseParamChange } as ParamChange; - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = object.subspace; - } else { - message.subspace = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/cosmos/params/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/cosmos/params/v1beta1/query.ts deleted file mode 100644 index 30572593..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/cosmos/params/v1beta1/query.ts +++ /dev/null @@ -1,199 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { ParamChange } from "../../../cosmos/params/v1beta1/params"; - -export const protobufPackage = "cosmos.params.v1beta1"; - -/** QueryParamsRequest is request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { - /** subspace defines the module to query the parameter for. */ - subspace: string; - /** key defines the key of the parameter in the subspace. */ - key: string; -} - -/** QueryParamsResponse is response type for the Query/Params RPC method. */ -export interface QueryParamsResponse { - /** param defines the queried parameter. */ - param: ParamChange | undefined; -} - -const baseQueryParamsRequest: object = { subspace: "", key: "" }; - -export const QueryParamsRequest = { - encode( - message: QueryParamsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.subspace !== "") { - writer.uint32(10).string(message.subspace); - } - if (message.key !== "") { - writer.uint32(18).string(message.key); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subspace = reader.string(); - break; - case 2: - message.key = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = String(object.subspace); - } else { - message.subspace = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - return message; - }, - - toJSON(message: QueryParamsRequest): unknown { - const obj: any = {}; - message.subspace !== undefined && (obj.subspace = message.subspace); - message.key !== undefined && (obj.key = message.key); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = object.subspace; - } else { - message.subspace = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - return message; - }, -}; - -const baseQueryParamsResponse: object = {}; - -export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.param !== undefined) { - ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.param = ParamChange.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.param !== undefined && object.param !== null) { - message.param = ParamChange.fromJSON(object.param); - } else { - message.param = undefined; - } - return message; - }, - - toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.param !== undefined && - (obj.param = message.param - ? ParamChange.toJSON(message.param) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.param !== undefined && object.param !== null) { - message.param = ParamChange.fromPartial(object.param); - } else { - message.param = undefined; - } - return message; - }, -}; - -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * Params queries a specific parameter of a module, given its subspace and - * key. - */ - Params(request: QueryParamsRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.params.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/package.json deleted file mode 100644 index a41b7662..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-params-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.params.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/params/types/proposal", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.params.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/index.ts deleted file mode 100644 index 0f0f9b43..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/index.ts +++ /dev/null @@ -1,239 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { SigningInfo } from "./module/types/cosmos/slashing/v1beta1/genesis" -import { ValidatorMissedBlocks } from "./module/types/cosmos/slashing/v1beta1/genesis" -import { MissedBlock } from "./module/types/cosmos/slashing/v1beta1/genesis" -import { ValidatorSigningInfo } from "./module/types/cosmos/slashing/v1beta1/slashing" -import { Params } from "./module/types/cosmos/slashing/v1beta1/slashing" - - -export { SigningInfo, ValidatorMissedBlocks, MissedBlock, ValidatorSigningInfo, Params }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Params: {}, - SigningInfo: {}, - SigningInfos: {}, - - _Structure: { - SigningInfo: getStructure(SigningInfo.fromPartial({})), - ValidatorMissedBlocks: getStructure(ValidatorMissedBlocks.fromPartial({})), - MissedBlock: getStructure(MissedBlock.fromPartial({})), - ValidatorSigningInfo: getStructure(ValidatorSigningInfo.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getSigningInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.SigningInfo[JSON.stringify(params)] ?? {} - }, - getSigningInfos: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.SigningInfos[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.slashing.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySigningInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.querySigningInfo( key.cons_address)).data - - - commit('QUERY', { query: 'SigningInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySigningInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getSigningInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySigningInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QuerySigningInfos({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.querySigningInfos(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.querySigningInfos({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'SigningInfos', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QuerySigningInfos', payload: { options: { all }, params: {...key},query }}) - return getters['getSigningInfos']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QuerySigningInfos API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgUnjail({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUnjail(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUnjail:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUnjail:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgUnjail({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUnjail(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUnjail:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUnjail:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/index.ts deleted file mode 100644 index 2ade4f62..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgUnjail } from "./types/cosmos/slashing/v1beta1/tx"; - - -const types = [ - ["/cosmos.slashing.v1beta1.MsgUnjail", MsgUnjail], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgUnjail: (data: MsgUnjail): EncodeObject => ({ typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", value: MsgUnjail.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/rest.ts deleted file mode 100644 index 9de08cff..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/rest.ts +++ /dev/null @@ -1,425 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface ProtobufAny { - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -export type V1Beta1MsgUnjailResponse = object; - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * Params represents the parameters used for by the slashing module. - */ -export interface V1Beta1Params { - /** @format int64 */ - signed_blocks_window?: string; - - /** @format byte */ - min_signed_per_window?: string; - downtime_jail_duration?: string; - - /** @format byte */ - slash_fraction_double_sign?: string; - - /** @format byte */ - slash_fraction_downtime?: string; -} - -export interface V1Beta1QueryParamsResponse { - /** Params represents the parameters used for by the slashing module. */ - params?: V1Beta1Params; -} - -export interface V1Beta1QuerySigningInfoResponse { - /** - * ValidatorSigningInfo defines a validator's signing info for monitoring their - * liveness activity. - */ - val_signing_info?: V1Beta1ValidatorSigningInfo; -} - -export interface V1Beta1QuerySigningInfosResponse { - info?: V1Beta1ValidatorSigningInfo[]; - - /** - * 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; - * } - */ - pagination?: V1Beta1PageResponse; -} - -/** -* ValidatorSigningInfo defines a validator's signing info for monitoring their -liveness activity. -*/ -export interface V1Beta1ValidatorSigningInfo { - address?: string; - - /** @format int64 */ - start_height?: string; - - /** - * Index which is incremented each time the validator was a bonded - * in a block and may have signed a precommit or not. This in conjunction with the - * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. - * @format int64 - */ - index_offset?: string; - - /** - * Timestamp until which the validator is jailed due to liveness downtime. - * @format date-time - */ - jailed_until?: string; - - /** - * Whether or not a validator has been tombstoned (killed out of validator set). It is set - * once the validator commits an equivocation or for any other configured misbehiavor. - */ - tombstoned?: boolean; - - /** - * A counter kept to avoid unnecessary array reads. - * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. - * @format int64 - */ - missed_blocks_counter?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/slashing/v1beta1/genesis.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryParams - * @summary Params queries the parameters of slashing module - * @request GET:/cosmos/slashing/v1beta1/params - */ - queryParams = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/slashing/v1beta1/params`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QuerySigningInfos - * @summary SigningInfos queries signing info of all validators - * @request GET:/cosmos/slashing/v1beta1/signing_infos - */ - querySigningInfos = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/slashing/v1beta1/signing_infos`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QuerySigningInfo - * @summary SigningInfo queries the signing info of given cons address - * @request GET:/cosmos/slashing/v1beta1/signing_infos/{cons_address} - */ - querySigningInfo = (cons_address: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/slashing/v1beta1/signing_infos/${cons_address}`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/genesis.ts deleted file mode 100644 index 5ad9d40d..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/genesis.ts +++ /dev/null @@ -1,448 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - Params, - ValidatorSigningInfo, -} from "../../../cosmos/slashing/v1beta1/slashing"; - -export const protobufPackage = "cosmos.slashing.v1beta1"; - -/** GenesisState defines the slashing module's genesis state. */ -export interface GenesisState { - /** params defines all the paramaters of related to deposit. */ - params: Params | undefined; - /** - * signing_infos represents a map between validator addresses and their - * signing infos. - */ - signing_infos: SigningInfo[]; - /** - * missed_blocks represents a map between validator addresses and their - * missed blocks. - */ - missed_blocks: ValidatorMissedBlocks[]; -} - -/** SigningInfo stores validator signing info of corresponding address. */ -export interface SigningInfo { - /** address is the validator address. */ - address: string; - /** validator_signing_info represents the signing info of this validator. */ - validator_signing_info: ValidatorSigningInfo | undefined; -} - -/** - * ValidatorMissedBlocks contains array of missed blocks of corresponding - * address. - */ -export interface ValidatorMissedBlocks { - /** address is the validator address. */ - address: string; - /** missed_blocks is an array of missed blocks by the validator. */ - missed_blocks: MissedBlock[]; -} - -/** MissedBlock contains height and missed status as boolean. */ -export interface MissedBlock { - /** index is the height at which the block was missed. */ - index: number; - /** missed is the missed status. */ - missed: boolean; -} - -const baseGenesisState: object = {}; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.signing_infos) { - SigningInfo.encode(v!, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.missed_blocks) { - ValidatorMissedBlocks.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.signing_infos = []; - message.missed_blocks = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - case 2: - message.signing_infos.push( - SigningInfo.decode(reader, reader.uint32()) - ); - break; - case 3: - message.missed_blocks.push( - ValidatorMissedBlocks.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.signing_infos = []; - message.missed_blocks = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.signing_infos !== undefined && object.signing_infos !== null) { - for (const e of object.signing_infos) { - message.signing_infos.push(SigningInfo.fromJSON(e)); - } - } - if (object.missed_blocks !== undefined && object.missed_blocks !== null) { - for (const e of object.missed_blocks) { - message.missed_blocks.push(ValidatorMissedBlocks.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - if (message.signing_infos) { - obj.signing_infos = message.signing_infos.map((e) => - e ? SigningInfo.toJSON(e) : undefined - ); - } else { - obj.signing_infos = []; - } - if (message.missed_blocks) { - obj.missed_blocks = message.missed_blocks.map((e) => - e ? ValidatorMissedBlocks.toJSON(e) : undefined - ); - } else { - obj.missed_blocks = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.signing_infos = []; - message.missed_blocks = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.signing_infos !== undefined && object.signing_infos !== null) { - for (const e of object.signing_infos) { - message.signing_infos.push(SigningInfo.fromPartial(e)); - } - } - if (object.missed_blocks !== undefined && object.missed_blocks !== null) { - for (const e of object.missed_blocks) { - message.missed_blocks.push(ValidatorMissedBlocks.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSigningInfo: object = { address: "" }; - -export const SigningInfo = { - encode(message: SigningInfo, writer: Writer = Writer.create()): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.validator_signing_info !== undefined) { - ValidatorSigningInfo.encode( - message.validator_signing_info, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SigningInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSigningInfo } as SigningInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.validator_signing_info = ValidatorSigningInfo.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SigningInfo { - const message = { ...baseSigningInfo } as SigningInfo; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if ( - object.validator_signing_info !== undefined && - object.validator_signing_info !== null - ) { - message.validator_signing_info = ValidatorSigningInfo.fromJSON( - object.validator_signing_info - ); - } else { - message.validator_signing_info = undefined; - } - return message; - }, - - toJSON(message: SigningInfo): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.validator_signing_info !== undefined && - (obj.validator_signing_info = message.validator_signing_info - ? ValidatorSigningInfo.toJSON(message.validator_signing_info) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): SigningInfo { - const message = { ...baseSigningInfo } as SigningInfo; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if ( - object.validator_signing_info !== undefined && - object.validator_signing_info !== null - ) { - message.validator_signing_info = ValidatorSigningInfo.fromPartial( - object.validator_signing_info - ); - } else { - message.validator_signing_info = undefined; - } - return message; - }, -}; - -const baseValidatorMissedBlocks: object = { address: "" }; - -export const ValidatorMissedBlocks = { - encode( - message: ValidatorMissedBlocks, - writer: Writer = Writer.create() - ): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - for (const v of message.missed_blocks) { - MissedBlock.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorMissedBlocks { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorMissedBlocks } as ValidatorMissedBlocks; - message.missed_blocks = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.missed_blocks.push( - MissedBlock.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorMissedBlocks { - const message = { ...baseValidatorMissedBlocks } as ValidatorMissedBlocks; - message.missed_blocks = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.missed_blocks !== undefined && object.missed_blocks !== null) { - for (const e of object.missed_blocks) { - message.missed_blocks.push(MissedBlock.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ValidatorMissedBlocks): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - if (message.missed_blocks) { - obj.missed_blocks = message.missed_blocks.map((e) => - e ? MissedBlock.toJSON(e) : undefined - ); - } else { - obj.missed_blocks = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorMissedBlocks { - const message = { ...baseValidatorMissedBlocks } as ValidatorMissedBlocks; - message.missed_blocks = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.missed_blocks !== undefined && object.missed_blocks !== null) { - for (const e of object.missed_blocks) { - message.missed_blocks.push(MissedBlock.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMissedBlock: object = { index: 0, missed: false }; - -export const MissedBlock = { - encode(message: MissedBlock, writer: Writer = Writer.create()): Writer { - if (message.index !== 0) { - writer.uint32(8).int64(message.index); - } - if (message.missed === true) { - writer.uint32(16).bool(message.missed); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MissedBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMissedBlock } as MissedBlock; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = longToNumber(reader.int64() as Long); - break; - case 2: - message.missed = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MissedBlock { - const message = { ...baseMissedBlock } as MissedBlock; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.missed !== undefined && object.missed !== null) { - message.missed = Boolean(object.missed); - } else { - message.missed = false; - } - return message; - }, - - toJSON(message: MissedBlock): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.missed !== undefined && (obj.missed = message.missed); - return obj; - }, - - fromPartial(object: DeepPartial): MissedBlock { - const message = { ...baseMissedBlock } as MissedBlock; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.missed !== undefined && object.missed !== null) { - message.missed = object.missed; - } else { - message.missed = false; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/query.ts deleted file mode 100644 index 9ed6a2fd..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/query.ts +++ /dev/null @@ -1,560 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { - Params, - ValidatorSigningInfo, -} from "../../../cosmos/slashing/v1beta1/slashing"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; - -export const protobufPackage = "cosmos.slashing.v1beta1"; - -/** QueryParamsRequest is the request type for the Query/Params RPC method */ -export interface QueryParamsRequest {} - -/** QueryParamsResponse is the response type for the Query/Params RPC method */ -export interface QueryParamsResponse { - params: Params | undefined; -} - -/** - * QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC - * method - */ -export interface QuerySigningInfoRequest { - /** cons_address is the address to query signing info of */ - cons_address: string; -} - -/** - * QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC - * method - */ -export interface QuerySigningInfoResponse { - /** val_signing_info is the signing info of requested val cons address */ - val_signing_info: ValidatorSigningInfo | undefined; -} - -/** - * QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC - * method - */ -export interface QuerySigningInfosRequest { - pagination: PageRequest | undefined; -} - -/** - * QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC - * method - */ -export interface QuerySigningInfosResponse { - /** info is the signing info of all validators */ - info: ValidatorSigningInfo[]; - pagination: PageResponse | undefined; -} - -const baseQueryParamsRequest: object = {}; - -export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, - - toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, -}; - -const baseQueryParamsResponse: object = {}; - -export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - 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): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -const baseQuerySigningInfoRequest: object = { cons_address: "" }; - -export const QuerySigningInfoRequest = { - encode( - message: QuerySigningInfoRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.cons_address !== "") { - writer.uint32(10).string(message.cons_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QuerySigningInfoRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySigningInfoRequest, - } as QuerySigningInfoRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cons_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QuerySigningInfoRequest { - const message = { - ...baseQuerySigningInfoRequest, - } as QuerySigningInfoRequest; - if (object.cons_address !== undefined && object.cons_address !== null) { - message.cons_address = String(object.cons_address); - } else { - message.cons_address = ""; - } - return message; - }, - - toJSON(message: QuerySigningInfoRequest): unknown { - const obj: any = {}; - message.cons_address !== undefined && - (obj.cons_address = message.cons_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QuerySigningInfoRequest { - const message = { - ...baseQuerySigningInfoRequest, - } as QuerySigningInfoRequest; - if (object.cons_address !== undefined && object.cons_address !== null) { - message.cons_address = object.cons_address; - } else { - message.cons_address = ""; - } - return message; - }, -}; - -const baseQuerySigningInfoResponse: object = {}; - -export const QuerySigningInfoResponse = { - encode( - message: QuerySigningInfoResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.val_signing_info !== undefined) { - ValidatorSigningInfo.encode( - message.val_signing_info, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySigningInfoResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySigningInfoResponse, - } as QuerySigningInfoResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.val_signing_info = ValidatorSigningInfo.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QuerySigningInfoResponse { - const message = { - ...baseQuerySigningInfoResponse, - } as QuerySigningInfoResponse; - if ( - object.val_signing_info !== undefined && - object.val_signing_info !== null - ) { - message.val_signing_info = ValidatorSigningInfo.fromJSON( - object.val_signing_info - ); - } else { - message.val_signing_info = undefined; - } - return message; - }, - - toJSON(message: QuerySigningInfoResponse): unknown { - const obj: any = {}; - message.val_signing_info !== undefined && - (obj.val_signing_info = message.val_signing_info - ? ValidatorSigningInfo.toJSON(message.val_signing_info) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QuerySigningInfoResponse { - const message = { - ...baseQuerySigningInfoResponse, - } as QuerySigningInfoResponse; - if ( - object.val_signing_info !== undefined && - object.val_signing_info !== null - ) { - message.val_signing_info = ValidatorSigningInfo.fromPartial( - object.val_signing_info - ); - } else { - message.val_signing_info = undefined; - } - return message; - }, -}; - -const baseQuerySigningInfosRequest: object = {}; - -export const QuerySigningInfosRequest = { - encode( - message: QuerySigningInfosRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySigningInfosRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySigningInfosRequest, - } as QuerySigningInfosRequest; - 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): QuerySigningInfosRequest { - const message = { - ...baseQuerySigningInfosRequest, - } as QuerySigningInfosRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QuerySigningInfosRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QuerySigningInfosRequest { - const message = { - ...baseQuerySigningInfosRequest, - } as QuerySigningInfosRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQuerySigningInfosResponse: object = {}; - -export const QuerySigningInfosResponse = { - encode( - message: QuerySigningInfosResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.info) { - ValidatorSigningInfo.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySigningInfosResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySigningInfosResponse, - } as QuerySigningInfosResponse; - message.info = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.info.push( - ValidatorSigningInfo.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): QuerySigningInfosResponse { - const message = { - ...baseQuerySigningInfosResponse, - } as QuerySigningInfosResponse; - message.info = []; - if (object.info !== undefined && object.info !== null) { - for (const e of object.info) { - message.info.push(ValidatorSigningInfo.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QuerySigningInfosResponse): unknown { - const obj: any = {}; - if (message.info) { - obj.info = message.info.map((e) => - e ? ValidatorSigningInfo.toJSON(e) : undefined - ); - } else { - obj.info = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QuerySigningInfosResponse { - const message = { - ...baseQuerySigningInfosResponse, - } as QuerySigningInfosResponse; - message.info = []; - if (object.info !== undefined && object.info !== null) { - for (const e of object.info) { - message.info.push(ValidatorSigningInfo.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -/** Query provides defines the gRPC querier service */ -export interface Query { - /** Params queries the parameters of slashing module */ - Params(request: QueryParamsRequest): Promise; - /** SigningInfo queries the signing info of given cons address */ - SigningInfo( - request: QuerySigningInfoRequest - ): Promise; - /** SigningInfos queries signing info of all validators */ - SigningInfos( - request: QuerySigningInfosRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.slashing.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } - - SigningInfo( - request: QuerySigningInfoRequest - ): Promise { - const data = QuerySigningInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.slashing.v1beta1.Query", - "SigningInfo", - data - ); - return promise.then((data) => - QuerySigningInfoResponse.decode(new Reader(data)) - ); - } - - SigningInfos( - request: QuerySigningInfosRequest - ): Promise { - const data = QuerySigningInfosRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.slashing.v1beta1.Query", - "SigningInfos", - data - ); - return promise.then((data) => - QuerySigningInfosResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/slashing.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/slashing.ts deleted file mode 100644 index 5642533c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/slashing.ts +++ /dev/null @@ -1,471 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Duration } from "../../../google/protobuf/duration"; - -export const protobufPackage = "cosmos.slashing.v1beta1"; - -/** - * ValidatorSigningInfo defines a validator's signing info for monitoring their - * liveness activity. - */ -export interface ValidatorSigningInfo { - address: string; - /** Height at which validator was first a candidate OR was unjailed */ - start_height: number; - /** - * Index which is incremented each time the validator was a bonded - * in a block and may have signed a precommit or not. This in conjunction with the - * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. - */ - index_offset: number; - /** Timestamp until which the validator is jailed due to liveness downtime. */ - jailed_until: Date | undefined; - /** - * Whether or not a validator has been tombstoned (killed out of validator set). It is set - * once the validator commits an equivocation or for any other configured misbehiavor. - */ - tombstoned: boolean; - /** - * A counter kept to avoid unnecessary array reads. - * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. - */ - missed_blocks_counter: number; -} - -/** Params represents the parameters used for by the slashing module. */ -export interface Params { - signed_blocks_window: number; - min_signed_per_window: Uint8Array; - downtime_jail_duration: Duration | undefined; - slash_fraction_double_sign: Uint8Array; - slash_fraction_downtime: Uint8Array; -} - -const baseValidatorSigningInfo: object = { - address: "", - start_height: 0, - index_offset: 0, - tombstoned: false, - missed_blocks_counter: 0, -}; - -export const ValidatorSigningInfo = { - encode( - message: ValidatorSigningInfo, - writer: Writer = Writer.create() - ): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.start_height !== 0) { - writer.uint32(16).int64(message.start_height); - } - if (message.index_offset !== 0) { - writer.uint32(24).int64(message.index_offset); - } - if (message.jailed_until !== undefined) { - Timestamp.encode( - toTimestamp(message.jailed_until), - writer.uint32(34).fork() - ).ldelim(); - } - if (message.tombstoned === true) { - writer.uint32(40).bool(message.tombstoned); - } - if (message.missed_blocks_counter !== 0) { - writer.uint32(48).int64(message.missed_blocks_counter); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorSigningInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSigningInfo } as ValidatorSigningInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.start_height = longToNumber(reader.int64() as Long); - break; - case 3: - message.index_offset = longToNumber(reader.int64() as Long); - break; - case 4: - message.jailed_until = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 5: - message.tombstoned = reader.bool(); - break; - case 6: - message.missed_blocks_counter = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorSigningInfo { - const message = { ...baseValidatorSigningInfo } as ValidatorSigningInfo; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.start_height !== undefined && object.start_height !== null) { - message.start_height = Number(object.start_height); - } else { - message.start_height = 0; - } - if (object.index_offset !== undefined && object.index_offset !== null) { - message.index_offset = Number(object.index_offset); - } else { - message.index_offset = 0; - } - if (object.jailed_until !== undefined && object.jailed_until !== null) { - message.jailed_until = fromJsonTimestamp(object.jailed_until); - } else { - message.jailed_until = undefined; - } - if (object.tombstoned !== undefined && object.tombstoned !== null) { - message.tombstoned = Boolean(object.tombstoned); - } else { - message.tombstoned = false; - } - if ( - object.missed_blocks_counter !== undefined && - object.missed_blocks_counter !== null - ) { - message.missed_blocks_counter = Number(object.missed_blocks_counter); - } else { - message.missed_blocks_counter = 0; - } - return message; - }, - - toJSON(message: ValidatorSigningInfo): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.start_height !== undefined && - (obj.start_height = message.start_height); - message.index_offset !== undefined && - (obj.index_offset = message.index_offset); - message.jailed_until !== undefined && - (obj.jailed_until = - message.jailed_until !== undefined - ? message.jailed_until.toISOString() - : null); - message.tombstoned !== undefined && (obj.tombstoned = message.tombstoned); - message.missed_blocks_counter !== undefined && - (obj.missed_blocks_counter = message.missed_blocks_counter); - return obj; - }, - - fromPartial(object: DeepPartial): ValidatorSigningInfo { - const message = { ...baseValidatorSigningInfo } as ValidatorSigningInfo; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.start_height !== undefined && object.start_height !== null) { - message.start_height = object.start_height; - } else { - message.start_height = 0; - } - if (object.index_offset !== undefined && object.index_offset !== null) { - message.index_offset = object.index_offset; - } else { - message.index_offset = 0; - } - if (object.jailed_until !== undefined && object.jailed_until !== null) { - message.jailed_until = object.jailed_until; - } else { - message.jailed_until = undefined; - } - if (object.tombstoned !== undefined && object.tombstoned !== null) { - message.tombstoned = object.tombstoned; - } else { - message.tombstoned = false; - } - if ( - object.missed_blocks_counter !== undefined && - object.missed_blocks_counter !== null - ) { - message.missed_blocks_counter = object.missed_blocks_counter; - } else { - message.missed_blocks_counter = 0; - } - return message; - }, -}; - -const baseParams: object = { signed_blocks_window: 0 }; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.signed_blocks_window !== 0) { - writer.uint32(8).int64(message.signed_blocks_window); - } - if (message.min_signed_per_window.length !== 0) { - writer.uint32(18).bytes(message.min_signed_per_window); - } - if (message.downtime_jail_duration !== undefined) { - Duration.encode( - message.downtime_jail_duration, - writer.uint32(26).fork() - ).ldelim(); - } - if (message.slash_fraction_double_sign.length !== 0) { - writer.uint32(34).bytes(message.slash_fraction_double_sign); - } - if (message.slash_fraction_downtime.length !== 0) { - writer.uint32(42).bytes(message.slash_fraction_downtime); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signed_blocks_window = longToNumber(reader.int64() as Long); - break; - case 2: - message.min_signed_per_window = reader.bytes(); - break; - case 3: - message.downtime_jail_duration = Duration.decode( - reader, - reader.uint32() - ); - break; - case 4: - message.slash_fraction_double_sign = reader.bytes(); - break; - case 5: - message.slash_fraction_downtime = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if ( - object.signed_blocks_window !== undefined && - object.signed_blocks_window !== null - ) { - message.signed_blocks_window = Number(object.signed_blocks_window); - } else { - message.signed_blocks_window = 0; - } - if ( - object.min_signed_per_window !== undefined && - object.min_signed_per_window !== null - ) { - message.min_signed_per_window = bytesFromBase64( - object.min_signed_per_window - ); - } - if ( - object.downtime_jail_duration !== undefined && - object.downtime_jail_duration !== null - ) { - message.downtime_jail_duration = Duration.fromJSON( - object.downtime_jail_duration - ); - } else { - message.downtime_jail_duration = undefined; - } - if ( - object.slash_fraction_double_sign !== undefined && - object.slash_fraction_double_sign !== null - ) { - message.slash_fraction_double_sign = bytesFromBase64( - object.slash_fraction_double_sign - ); - } - if ( - object.slash_fraction_downtime !== undefined && - object.slash_fraction_downtime !== null - ) { - message.slash_fraction_downtime = bytesFromBase64( - object.slash_fraction_downtime - ); - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.signed_blocks_window !== undefined && - (obj.signed_blocks_window = message.signed_blocks_window); - message.min_signed_per_window !== undefined && - (obj.min_signed_per_window = base64FromBytes( - message.min_signed_per_window !== undefined - ? message.min_signed_per_window - : new Uint8Array() - )); - message.downtime_jail_duration !== undefined && - (obj.downtime_jail_duration = message.downtime_jail_duration - ? Duration.toJSON(message.downtime_jail_duration) - : undefined); - message.slash_fraction_double_sign !== undefined && - (obj.slash_fraction_double_sign = base64FromBytes( - message.slash_fraction_double_sign !== undefined - ? message.slash_fraction_double_sign - : new Uint8Array() - )); - message.slash_fraction_downtime !== undefined && - (obj.slash_fraction_downtime = base64FromBytes( - message.slash_fraction_downtime !== undefined - ? message.slash_fraction_downtime - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if ( - object.signed_blocks_window !== undefined && - object.signed_blocks_window !== null - ) { - message.signed_blocks_window = object.signed_blocks_window; - } else { - message.signed_blocks_window = 0; - } - if ( - object.min_signed_per_window !== undefined && - object.min_signed_per_window !== null - ) { - message.min_signed_per_window = object.min_signed_per_window; - } else { - message.min_signed_per_window = new Uint8Array(); - } - if ( - object.downtime_jail_duration !== undefined && - object.downtime_jail_duration !== null - ) { - message.downtime_jail_duration = Duration.fromPartial( - object.downtime_jail_duration - ); - } else { - message.downtime_jail_duration = undefined; - } - if ( - object.slash_fraction_double_sign !== undefined && - object.slash_fraction_double_sign !== null - ) { - message.slash_fraction_double_sign = object.slash_fraction_double_sign; - } else { - message.slash_fraction_double_sign = new Uint8Array(); - } - if ( - object.slash_fraction_downtime !== undefined && - object.slash_fraction_downtime !== null - ) { - message.slash_fraction_downtime = object.slash_fraction_downtime; - } else { - message.slash_fraction_downtime = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/tx.ts deleted file mode 100644 index a7028b64..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/cosmos/slashing/v1beta1/tx.ts +++ /dev/null @@ -1,151 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.slashing.v1beta1"; - -/** MsgUnjail defines the Msg/Unjail request type */ -export interface MsgUnjail { - validator_addr: string; -} - -/** MsgUnjailResponse defines the Msg/Unjail response type */ -export interface MsgUnjailResponse {} - -const baseMsgUnjail: object = { validator_addr: "" }; - -export const MsgUnjail = { - encode(message: MsgUnjail, writer: Writer = Writer.create()): Writer { - if (message.validator_addr !== "") { - writer.uint32(10).string(message.validator_addr); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgUnjail { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUnjail } as MsgUnjail; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_addr = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUnjail { - const message = { ...baseMsgUnjail } as MsgUnjail; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; - }, - - toJSON(message: MsgUnjail): unknown { - const obj: any = {}; - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); - return obj; - }, - - fromPartial(object: DeepPartial): MsgUnjail { - const message = { ...baseMsgUnjail } as MsgUnjail; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } - return message; - }, -}; - -const baseMsgUnjailResponse: object = {}; - -export const MsgUnjailResponse = { - encode(_: MsgUnjailResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgUnjailResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUnjailResponse { - const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; - return message; - }, - - toJSON(_: MsgUnjailResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgUnjailResponse { - const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; - return message; - }, -}; - -/** Msg defines the slashing Msg service. */ -export interface Msg { - /** - * Unjail defines a method for unjailing a jailed validator, thus returning - * them into the bonded validator set, so they can begin receiving provisions - * and rewards again. - */ - Unjail(request: MsgUnjail): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Unjail(request: MsgUnjail): Promise { - const data = MsgUnjail.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.slashing.v1beta1.Msg", - "Unjail", - data - ); - return promise.then((data) => MsgUnjailResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/protobuf/duration.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/protobuf/duration.ts deleted file mode 100644 index fffd5b14..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/protobuf/duration.ts +++ /dev/null @@ -1,188 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - */ -export interface Duration { - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ - seconds: number; - /** - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - */ - nanos: number; -} - -const baseDuration: object = { seconds: 0, nanos: 0 }; - -export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDuration } as Duration; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Duration): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/package.json deleted file mode 100644 index f284fa51..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-slashing-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.slashing.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/slashing/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.slashing.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/index.ts deleted file mode 100644 index 3076273d..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/index.ts +++ /dev/null @@ -1,730 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { StakeAuthorization } from "./module/types/cosmos/staking/v1beta1/authz" -import { StakeAuthorization_Validators } from "./module/types/cosmos/staking/v1beta1/authz" -import { LastValidatorPower } from "./module/types/cosmos/staking/v1beta1/genesis" -import { HistoricalInfo } from "./module/types/cosmos/staking/v1beta1/staking" -import { CommissionRates } from "./module/types/cosmos/staking/v1beta1/staking" -import { Commission } from "./module/types/cosmos/staking/v1beta1/staking" -import { Description } from "./module/types/cosmos/staking/v1beta1/staking" -import { Validator } from "./module/types/cosmos/staking/v1beta1/staking" -import { ValAddresses } from "./module/types/cosmos/staking/v1beta1/staking" -import { DVPair } from "./module/types/cosmos/staking/v1beta1/staking" -import { DVPairs } from "./module/types/cosmos/staking/v1beta1/staking" -import { DVVTriplet } from "./module/types/cosmos/staking/v1beta1/staking" -import { DVVTriplets } from "./module/types/cosmos/staking/v1beta1/staking" -import { Delegation } from "./module/types/cosmos/staking/v1beta1/staking" -import { UnbondingDelegation } from "./module/types/cosmos/staking/v1beta1/staking" -import { UnbondingDelegationEntry } from "./module/types/cosmos/staking/v1beta1/staking" -import { RedelegationEntry } from "./module/types/cosmos/staking/v1beta1/staking" -import { Redelegation } from "./module/types/cosmos/staking/v1beta1/staking" -import { Params } from "./module/types/cosmos/staking/v1beta1/staking" -import { DelegationResponse } from "./module/types/cosmos/staking/v1beta1/staking" -import { RedelegationEntryResponse } from "./module/types/cosmos/staking/v1beta1/staking" -import { RedelegationResponse } from "./module/types/cosmos/staking/v1beta1/staking" -import { Pool } from "./module/types/cosmos/staking/v1beta1/staking" - - -export { StakeAuthorization, StakeAuthorization_Validators, LastValidatorPower, HistoricalInfo, CommissionRates, Commission, Description, Validator, ValAddresses, DVPair, DVPairs, DVVTriplet, DVVTriplets, Delegation, UnbondingDelegation, UnbondingDelegationEntry, RedelegationEntry, Redelegation, Params, DelegationResponse, RedelegationEntryResponse, RedelegationResponse, Pool }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Validators: {}, - Validator: {}, - ValidatorDelegations: {}, - ValidatorUnbondingDelegations: {}, - Delegation: {}, - UnbondingDelegation: {}, - DelegatorDelegations: {}, - DelegatorUnbondingDelegations: {}, - Redelegations: {}, - DelegatorValidators: {}, - DelegatorValidator: {}, - HistoricalInfo: {}, - Pool: {}, - Params: {}, - - _Structure: { - StakeAuthorization: getStructure(StakeAuthorization.fromPartial({})), - StakeAuthorization_Validators: getStructure(StakeAuthorization_Validators.fromPartial({})), - LastValidatorPower: getStructure(LastValidatorPower.fromPartial({})), - HistoricalInfo: getStructure(HistoricalInfo.fromPartial({})), - CommissionRates: getStructure(CommissionRates.fromPartial({})), - Commission: getStructure(Commission.fromPartial({})), - Description: getStructure(Description.fromPartial({})), - Validator: getStructure(Validator.fromPartial({})), - ValAddresses: getStructure(ValAddresses.fromPartial({})), - DVPair: getStructure(DVPair.fromPartial({})), - DVPairs: getStructure(DVPairs.fromPartial({})), - DVVTriplet: getStructure(DVVTriplet.fromPartial({})), - DVVTriplets: getStructure(DVVTriplets.fromPartial({})), - Delegation: getStructure(Delegation.fromPartial({})), - UnbondingDelegation: getStructure(UnbondingDelegation.fromPartial({})), - UnbondingDelegationEntry: getStructure(UnbondingDelegationEntry.fromPartial({})), - RedelegationEntry: getStructure(RedelegationEntry.fromPartial({})), - Redelegation: getStructure(Redelegation.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - DelegationResponse: getStructure(DelegationResponse.fromPartial({})), - RedelegationEntryResponse: getStructure(RedelegationEntryResponse.fromPartial({})), - RedelegationResponse: getStructure(RedelegationResponse.fromPartial({})), - Pool: getStructure(Pool.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getValidators: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Validators[JSON.stringify(params)] ?? {} - }, - getValidator: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Validator[JSON.stringify(params)] ?? {} - }, - getValidatorDelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorDelegations[JSON.stringify(params)] ?? {} - }, - getValidatorUnbondingDelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorUnbondingDelegations[JSON.stringify(params)] ?? {} - }, - getDelegation: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Delegation[JSON.stringify(params)] ?? {} - }, - getUnbondingDelegation: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UnbondingDelegation[JSON.stringify(params)] ?? {} - }, - getDelegatorDelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorDelegations[JSON.stringify(params)] ?? {} - }, - getDelegatorUnbondingDelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorUnbondingDelegations[JSON.stringify(params)] ?? {} - }, - getRedelegations: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Redelegations[JSON.stringify(params)] ?? {} - }, - getDelegatorValidators: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorValidators[JSON.stringify(params)] ?? {} - }, - getDelegatorValidator: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DelegatorValidator[JSON.stringify(params)] ?? {} - }, - getHistoricalInfo: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.HistoricalInfo[JSON.stringify(params)] ?? {} - }, - getPool: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Pool[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.staking.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryValidators({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryValidators(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryValidators({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Validators', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidators', payload: { options: { all }, params: {...key},query }}) - return getters['getValidators']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidators API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidator({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryValidator( key.validator_addr)).data - - - commit('QUERY', { query: 'Validator', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidator', payload: { options: { all }, params: {...key},query }}) - return getters['getValidator']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidator API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorDelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryValidatorDelegations( key.validator_addr, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryValidatorDelegations( key.validator_addr, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ValidatorDelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorDelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorDelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorDelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorUnbondingDelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryValidatorUnbondingDelegations( key.validator_addr, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryValidatorUnbondingDelegations( key.validator_addr, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ValidatorUnbondingDelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorUnbondingDelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorUnbondingDelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorUnbondingDelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegation({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDelegation( key.validator_addr, key.delegator_addr)).data - - - commit('QUERY', { query: 'Delegation', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegation', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegation']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegation API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUnbondingDelegation({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryUnbondingDelegation( key.validator_addr, key.delegator_addr)).data - - - commit('QUERY', { query: 'UnbondingDelegation', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUnbondingDelegation', payload: { options: { all }, params: {...key},query }}) - return getters['getUnbondingDelegation']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUnbondingDelegation API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorDelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDelegatorDelegations( key.delegator_addr, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryDelegatorDelegations( key.delegator_addr, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DelegatorDelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorDelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorDelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorDelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorUnbondingDelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDelegatorUnbondingDelegations( key.delegator_addr, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryDelegatorUnbondingDelegations( key.delegator_addr, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DelegatorUnbondingDelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorUnbondingDelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorUnbondingDelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorUnbondingDelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryRedelegations({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryRedelegations( key.delegator_addr, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryRedelegations( key.delegator_addr, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Redelegations', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryRedelegations', payload: { options: { all }, params: {...key},query }}) - return getters['getRedelegations']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryRedelegations API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorValidators({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDelegatorValidators( key.delegator_addr, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryDelegatorValidators( key.delegator_addr, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DelegatorValidators', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorValidators', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorValidators']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorValidators API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDelegatorValidator({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDelegatorValidator( key.delegator_addr, key.validator_addr)).data - - - commit('QUERY', { query: 'DelegatorValidator', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDelegatorValidator', payload: { options: { all }, params: {...key},query }}) - return getters['getDelegatorValidator']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDelegatorValidator API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryHistoricalInfo({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryHistoricalInfo( key.height)).data - - - commit('QUERY', { query: 'HistoricalInfo', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryHistoricalInfo', payload: { options: { all }, params: {...key},query }}) - return getters['getHistoricalInfo']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryHistoricalInfo API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPool({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryPool()).data - - - commit('QUERY', { query: 'Pool', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPool', payload: { options: { all }, params: {...key},query }}) - return getters['getPool']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPool API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgBeginRedelegate({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgBeginRedelegate(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgBeginRedelegate:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgBeginRedelegate:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUndelegate({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUndelegate(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUndelegate:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUndelegate:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreateValidator({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateValidator(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateValidator:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateValidator:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgDelegate({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgDelegate(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDelegate:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgDelegate:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgEditValidator({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgEditValidator(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgEditValidator:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgEditValidator:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgBeginRedelegate({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgBeginRedelegate(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgBeginRedelegate:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgBeginRedelegate:Create Could not create message: ' + e.message) - } - } - }, - async MsgUndelegate({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUndelegate(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUndelegate:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUndelegate:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreateValidator({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateValidator(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateValidator:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateValidator:Create Could not create message: ' + e.message) - } - } - }, - async MsgDelegate({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgDelegate(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDelegate:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgDelegate:Create Could not create message: ' + e.message) - } - } - }, - async MsgEditValidator({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgEditValidator(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgEditValidator:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgEditValidator:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/index.ts deleted file mode 100644 index dc4e5ef9..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/index.ts +++ /dev/null @@ -1,72 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgBeginRedelegate } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgUndelegate } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgCreateValidator } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgDelegate } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgEditValidator } from "./types/cosmos/staking/v1beta1/tx"; - - -const types = [ - ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], - ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], - ["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], - ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], - ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgBeginRedelegate: (data: MsgBeginRedelegate): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", value: MsgBeginRedelegate.fromPartial( data ) }), - msgUndelegate: (data: MsgUndelegate): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.fromPartial( data ) }), - msgCreateValidator: (data: MsgCreateValidator): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", value: MsgCreateValidator.fromPartial( data ) }), - msgDelegate: (data: MsgDelegate): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", value: MsgDelegate.fromPartial( data ) }), - msgEditValidator: (data: MsgEditValidator): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", value: MsgEditValidator.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/rest.ts deleted file mode 100644 index e960b00a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/rest.ts +++ /dev/null @@ -1,1251 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* Validator defines a validator, together with the total amount of the -Validator's bond shares and their exchange rate to coins. Slashing results in -a decrease in the exchange rate, allowing correct calculation of future -undelegations without iterating over delegators. When coins are delegated to -this validator, the validator is credited with a delegation whose number of -bond shares is based on the amount of coins delegated divided by the current -exchange rate. Voting power can be calculated as total bonded shares -multiplied by exchange rate. -*/ -export interface Stakingv1Beta1Validator { - /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ - operator_address?: string; - - /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ - consensus_pubkey?: ProtobufAny; - - /** jailed defined whether the validator has been jailed from bonded status or not. */ - jailed?: boolean; - - /** status is the validator status (bonded/unbonding/unbonded). */ - status?: V1Beta1BondStatus; - - /** tokens define the delegated tokens (incl. self-delegation). */ - tokens?: string; - - /** delegator_shares defines total shares issued to a validator's delegators. */ - delegator_shares?: string; - - /** description defines the description terms for the validator. */ - description?: V1Beta1Description; - - /** - * unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. - * @format int64 - */ - unbonding_height?: string; - - /** - * unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - * @format date-time - */ - unbonding_time?: string; - - /** commission defines the commission parameters. */ - commission?: V1Beta1Commission; - - /** min_self_delegation is the validator's self declared minimum self delegation. */ - min_self_delegation?: string; -} - -export interface TypesBlockID { - /** @format byte */ - hash?: string; - part_set_header?: TypesPartSetHeader; -} - -/** - * Header defines the structure of a Tendermint block header. - */ -export interface TypesHeader { - /** - * Consensus captures the consensus rules for processing a block in the blockchain, - * including all blockchain data structures and the rules of the application's - * state transition machine. - */ - version?: VersionConsensus; - chain_id?: string; - - /** @format int64 */ - height?: string; - - /** @format date-time */ - time?: string; - last_block_id?: TypesBlockID; - - /** @format byte */ - last_commit_hash?: string; - - /** @format byte */ - data_hash?: string; - - /** @format byte */ - validators_hash?: string; - - /** @format byte */ - next_validators_hash?: string; - - /** @format byte */ - consensus_hash?: string; - - /** @format byte */ - app_hash?: string; - - /** @format byte */ - last_results_hash?: string; - - /** @format byte */ - evidence_hash?: string; - - /** @format byte */ - proposer_address?: string; -} - -export interface TypesPartSetHeader { - /** @format int64 */ - total?: number; - - /** @format byte */ - hash?: string; -} - -/** -* BondStatus is the status of a validator. - - - BOND_STATUS_UNSPECIFIED: UNSPECIFIED defines an invalid validator status. - - BOND_STATUS_UNBONDED: UNBONDED defines a validator that is not bonded. - - BOND_STATUS_UNBONDING: UNBONDING defines a validator that is unbonding. - - BOND_STATUS_BONDED: BONDED defines a validator that is bonded. -*/ -export enum V1Beta1BondStatus { - BOND_STATUS_UNSPECIFIED = "BOND_STATUS_UNSPECIFIED", - BOND_STATUS_UNBONDED = "BOND_STATUS_UNBONDED", - BOND_STATUS_UNBONDING = "BOND_STATUS_UNBONDING", - BOND_STATUS_BONDED = "BOND_STATUS_BONDED", -} - -/** -* 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 V1Beta1Coin { - denom?: string; - amount?: string; -} - -/** - * Commission defines commission parameters for a given validator. - */ -export interface V1Beta1Commission { - /** commission_rates defines the initial commission rates to be used for creating a validator. */ - commission_rates?: V1Beta1CommissionRates; - - /** - * update_time is the last time the commission rate was changed. - * @format date-time - */ - update_time?: string; -} - -/** -* CommissionRates defines the initial commission rates to be used for creating -a validator. -*/ -export interface V1Beta1CommissionRates { - /** rate is the commission rate charged to delegators, as a fraction. */ - rate?: string; - - /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ - max_rate?: string; - - /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ - max_change_rate?: string; -} - -/** -* Delegation represents the bond with tokens held by an account. It is -owned by one delegator, and is associated with the voting power of one -validator. -*/ -export interface V1Beta1Delegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - - /** validator_address is the bech32-encoded address of the validator. */ - validator_address?: string; - - /** shares define the delegation shares received. */ - shares?: string; -} - -/** -* DelegationResponse is equivalent to Delegation except that it contains a -balance in addition to shares which is more suitable for client responses. -*/ -export interface V1Beta1DelegationResponse { - /** - * Delegation represents the bond with tokens held by an account. It is - * owned by one delegator, and is associated with the voting power of one - * validator. - */ - delegation?: V1Beta1Delegation; - - /** - * 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. - */ - balance?: V1Beta1Coin; -} - -/** - * Description defines a validator description. - */ -export interface V1Beta1Description { - /** moniker defines a human-readable name for the validator. */ - moniker?: string; - - /** identity defines an optional identity signature (ex. UPort or Keybase). */ - identity?: string; - - /** website defines an optional website link. */ - website?: string; - - /** security_contact defines an optional email for security contact. */ - security_contact?: string; - - /** details define other optional details. */ - details?: string; -} - -/** -* HistoricalInfo contains header and validator information for a given block. -It is stored as part of staking module's state, which persists the `n` most -recent HistoricalInfo -(`n` is set by the staking module's `historical_entries` parameter). -*/ -export interface V1Beta1HistoricalInfo { - /** Header defines the structure of a Tendermint block header. */ - header?: TypesHeader; - valset?: Stakingv1Beta1Validator[]; -} - -/** - * MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. - */ -export interface V1Beta1MsgBeginRedelegateResponse { - /** @format date-time */ - completion_time?: string; -} - -/** - * MsgCreateValidatorResponse defines the Msg/CreateValidator response type. - */ -export type V1Beta1MsgCreateValidatorResponse = object; - -/** - * MsgDelegateResponse defines the Msg/Delegate response type. - */ -export type V1Beta1MsgDelegateResponse = object; - -/** - * MsgEditValidatorResponse defines the Msg/EditValidator response type. - */ -export type V1Beta1MsgEditValidatorResponse = object; - -/** - * MsgUndelegateResponse defines the Msg/Undelegate response type. - */ -export interface V1Beta1MsgUndelegateResponse { - /** @format date-time */ - completion_time?: string; -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * Params defines the parameters for the staking module. - */ -export interface V1Beta1Params { - /** unbonding_time is the time duration of unbonding. */ - unbonding_time?: string; - - /** - * max_validators is the maximum number of validators. - * @format int64 - */ - max_validators?: number; - - /** - * max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). - * @format int64 - */ - max_entries?: number; - - /** - * historical_entries is the number of historical entries to persist. - * @format int64 - */ - historical_entries?: number; - - /** bond_denom defines the bondable coin denomination. */ - bond_denom?: string; -} - -/** -* Pool is used for tracking bonded and not-bonded token supply of the bond -denomination. -*/ -export interface V1Beta1Pool { - not_bonded_tokens?: string; - bonded_tokens?: string; -} - -/** - * QueryDelegationResponse is response type for the Query/Delegation RPC method. - */ -export interface V1Beta1QueryDelegationResponse { - /** delegation_responses defines the delegation info of a delegation. */ - delegation_response?: V1Beta1DelegationResponse; -} - -/** -* QueryDelegatorDelegationsResponse is response type for the -Query/DelegatorDelegations RPC method. -*/ -export interface V1Beta1QueryDelegatorDelegationsResponse { - /** delegation_responses defines all the delegations' info of a delegator. */ - delegation_responses?: V1Beta1DelegationResponse[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** -* QueryUnbondingDelegatorDelegationsResponse is response type for the -Query/UnbondingDelegatorDelegations RPC method. -*/ -export interface V1Beta1QueryDelegatorUnbondingDelegationsResponse { - unbonding_responses?: V1Beta1UnbondingDelegation[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** -* QueryDelegatorValidatorResponse response type for the -Query/DelegatorValidator RPC method. -*/ -export interface V1Beta1QueryDelegatorValidatorResponse { - /** validator defines the the validator info. */ - validator?: Stakingv1Beta1Validator; -} - -/** -* QueryDelegatorValidatorsResponse is response type for the -Query/DelegatorValidators RPC method. -*/ -export interface V1Beta1QueryDelegatorValidatorsResponse { - /** validators defines the the validators' info of a delegator. */ - validators?: Stakingv1Beta1Validator[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** -* QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC -method. -*/ -export interface V1Beta1QueryHistoricalInfoResponse { - /** hist defines the historical info at the given height. */ - hist?: V1Beta1HistoricalInfo; -} - -/** - * QueryParamsResponse is response type for the Query/Params RPC method. - */ -export interface V1Beta1QueryParamsResponse { - /** params holds all the parameters of this module. */ - params?: V1Beta1Params; -} - -/** - * QueryPoolResponse is response type for the Query/Pool RPC method. - */ -export interface V1Beta1QueryPoolResponse { - /** pool defines the pool info. */ - pool?: V1Beta1Pool; -} - -/** -* QueryRedelegationsResponse is response type for the Query/Redelegations RPC -method. -*/ -export interface V1Beta1QueryRedelegationsResponse { - redelegation_responses?: V1Beta1RedelegationResponse[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** -* QueryDelegationResponse is response type for the Query/UnbondingDelegation -RPC method. -*/ -export interface V1Beta1QueryUnbondingDelegationResponse { - /** unbond defines the unbonding information of a delegation. */ - unbond?: V1Beta1UnbondingDelegation; -} - -export interface V1Beta1QueryValidatorDelegationsResponse { - delegation_responses?: V1Beta1DelegationResponse[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -export interface V1Beta1QueryValidatorResponse { - /** validator defines the the validator info. */ - validator?: Stakingv1Beta1Validator; -} - -/** -* QueryValidatorUnbondingDelegationsResponse is response type for the -Query/ValidatorUnbondingDelegations RPC method. -*/ -export interface V1Beta1QueryValidatorUnbondingDelegationsResponse { - unbonding_responses?: V1Beta1UnbondingDelegation[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -export interface V1Beta1QueryValidatorsResponse { - /** validators contains all the queried validators. */ - validators?: Stakingv1Beta1Validator[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** -* Redelegation contains the list of a particular delegator's redelegating bonds -from a particular source validator to a particular destination validator. -*/ -export interface V1Beta1Redelegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - - /** validator_src_address is the validator redelegation source operator address. */ - validator_src_address?: string; - - /** validator_dst_address is the validator redelegation destination operator address. */ - validator_dst_address?: string; - - /** entries are the redelegation entries. */ - entries?: V1Beta1RedelegationEntry[]; -} - -/** - * RedelegationEntry defines a redelegation object with relevant metadata. - */ -export interface V1Beta1RedelegationEntry { - /** - * creation_height defines the height which the redelegation took place. - * @format int64 - */ - creation_height?: string; - - /** - * completion_time defines the unix time for redelegation completion. - * @format date-time - */ - completion_time?: string; - - /** initial_balance defines the initial balance when redelegation started. */ - initial_balance?: string; - - /** shares_dst is the amount of destination-validator shares created by redelegation. */ - shares_dst?: string; -} - -/** -* RedelegationEntryResponse is equivalent to a RedelegationEntry except that it -contains a balance in addition to shares which is more suitable for client -responses. -*/ -export interface V1Beta1RedelegationEntryResponse { - /** RedelegationEntry defines a redelegation object with relevant metadata. */ - redelegation_entry?: V1Beta1RedelegationEntry; - balance?: string; -} - -/** -* RedelegationResponse is equivalent to a Redelegation except that its entries -contain a balance in addition to shares which is more suitable for client -responses. -*/ -export interface V1Beta1RedelegationResponse { - /** - * Redelegation contains the list of a particular delegator's redelegating bonds - * from a particular source validator to a particular destination validator. - */ - redelegation?: V1Beta1Redelegation; - entries?: V1Beta1RedelegationEntryResponse[]; -} - -/** -* UnbondingDelegation stores all of a single delegator's unbonding bonds -for a single validator in an time-ordered list. -*/ -export interface V1Beta1UnbondingDelegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - - /** validator_address is the bech32-encoded address of the validator. */ - validator_address?: string; - - /** entries are the unbonding delegation entries. */ - entries?: V1Beta1UnbondingDelegationEntry[]; -} - -/** - * UnbondingDelegationEntry defines an unbonding object with relevant metadata. - */ -export interface V1Beta1UnbondingDelegationEntry { - /** - * creation_height is the height which the unbonding took place. - * @format int64 - */ - creation_height?: string; - - /** - * completion_time is the unix time for unbonding completion. - * @format date-time - */ - completion_time?: string; - - /** initial_balance defines the tokens initially scheduled to receive at completion. */ - initial_balance?: string; - - /** balance defines the tokens to receive at completion. */ - balance?: string; -} - -/** -* Consensus captures the consensus rules for processing a block in the blockchain, -including all blockchain data structures and the rules of the application's -state transition machine. -*/ -export interface VersionConsensus { - /** @format uint64 */ - block?: string; - - /** @format uint64 */ - app?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/staking/v1beta1/authz.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryDelegatorDelegations - * @summary DelegatorDelegations queries all delegations of a given delegator address. - * @request GET:/cosmos/staking/v1beta1/delegations/{delegator_addr} - */ - queryDelegatorDelegations = ( - delegator_addr: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/staking/v1beta1/delegations/${delegator_addr}`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryRedelegations - * @summary Redelegations queries redelegations of given address. - * @request GET:/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations - */ - queryRedelegations = ( - delegator_addr: string, - query?: { - src_validator_addr?: string; - dst_validator_addr?: string; - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/staking/v1beta1/delegators/${delegator_addr}/redelegations`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDelegatorUnbondingDelegations - * @summary DelegatorUnbondingDelegations queries all unbonding delegations of a given -delegator address. - * @request GET:/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations - */ - queryDelegatorUnbondingDelegations = ( - delegator_addr: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/staking/v1beta1/delegators/${delegator_addr}/unbonding_delegations`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDelegatorValidators - * @summary DelegatorValidators queries all validators info for given delegator -address. - * @request GET:/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators - */ - queryDelegatorValidators = ( - delegator_addr: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/staking/v1beta1/delegators/${delegator_addr}/validators`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDelegatorValidator - * @summary DelegatorValidator queries validator info for given delegator validator -pair. - * @request GET:/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr} - */ - queryDelegatorValidator = (delegator_addr: string, validator_addr: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/staking/v1beta1/delegators/${delegator_addr}/validators/${validator_addr}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryHistoricalInfo - * @summary HistoricalInfo queries the historical info for given height. - * @request GET:/cosmos/staking/v1beta1/historical_info/{height} - */ - queryHistoricalInfo = (height: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/staking/v1beta1/historical_info/${height}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryParams - * @summary Parameters queries the staking parameters. - * @request GET:/cosmos/staking/v1beta1/params - */ - queryParams = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/staking/v1beta1/params`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryPool - * @summary Pool queries the pool info. - * @request GET:/cosmos/staking/v1beta1/pool - */ - queryPool = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/staking/v1beta1/pool`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryValidators - * @summary Validators queries all validators that match the given status. - * @request GET:/cosmos/staking/v1beta1/validators - */ - queryValidators = ( - query?: { - status?: string; - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/staking/v1beta1/validators`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryValidator - * @summary Validator queries validator info for given validator address. - * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr} - */ - queryValidator = (validator_addr: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryValidatorDelegations - * @summary ValidatorDelegations queries delegate info for given validator. - * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr}/delegations - */ - queryValidatorDelegations = ( - validator_addr: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}/delegations`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDelegation - * @summary Delegation queries delegate info for given validator delegator pair. - * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr} - */ - queryDelegation = (validator_addr: string, delegator_addr: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}/delegations/${delegator_addr}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryUnbondingDelegation - * @summary UnbondingDelegation queries unbonding info for given validator delegator -pair. - * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation - */ - queryUnbondingDelegation = (validator_addr: string, delegator_addr: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}/delegations/${delegator_addr}/unbonding_delegation`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryValidatorUnbondingDelegations - * @summary ValidatorUnbondingDelegations queries unbonding delegations of a validator. - * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations - */ - queryValidatorUnbondingDelegations = ( - validator_addr: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}/unbonding_delegations`, - method: "GET", - query: query, - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ce2ac984..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - 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 { - denom: string; - amount: string; -} - -/** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProto { - int: string; -} - -/** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProto { - dec: string; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - 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 { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - 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): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { - if (message.int !== "") { - writer.uint32(10).string(message.int); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - 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 { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { - if (message.dec !== "") { - writer.uint32(10).string(message.dec); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - 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 { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/authz.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/authz.ts deleted file mode 100644 index 355022cb..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/authz.ts +++ /dev/null @@ -1,321 +0,0 @@ -/* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.staking.v1beta1"; - -/** - * AuthorizationType defines the type of staking module authorization type - * - * Since: cosmos-sdk 0.43 - */ -export enum AuthorizationType { - /** AUTHORIZATION_TYPE_UNSPECIFIED - AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type */ - AUTHORIZATION_TYPE_UNSPECIFIED = 0, - /** AUTHORIZATION_TYPE_DELEGATE - AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate */ - AUTHORIZATION_TYPE_DELEGATE = 1, - /** AUTHORIZATION_TYPE_UNDELEGATE - AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate */ - AUTHORIZATION_TYPE_UNDELEGATE = 2, - /** AUTHORIZATION_TYPE_REDELEGATE - AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate */ - AUTHORIZATION_TYPE_REDELEGATE = 3, - UNRECOGNIZED = -1, -} - -export function authorizationTypeFromJSON(object: any): AuthorizationType { - switch (object) { - case 0: - case "AUTHORIZATION_TYPE_UNSPECIFIED": - return AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED; - case 1: - case "AUTHORIZATION_TYPE_DELEGATE": - return AuthorizationType.AUTHORIZATION_TYPE_DELEGATE; - case 2: - case "AUTHORIZATION_TYPE_UNDELEGATE": - return AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE; - case 3: - case "AUTHORIZATION_TYPE_REDELEGATE": - return AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE; - case -1: - case "UNRECOGNIZED": - default: - return AuthorizationType.UNRECOGNIZED; - } -} - -export function authorizationTypeToJSON(object: AuthorizationType): string { - switch (object) { - case AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED: - return "AUTHORIZATION_TYPE_UNSPECIFIED"; - case AuthorizationType.AUTHORIZATION_TYPE_DELEGATE: - return "AUTHORIZATION_TYPE_DELEGATE"; - case AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE: - return "AUTHORIZATION_TYPE_UNDELEGATE"; - case AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE: - return "AUTHORIZATION_TYPE_REDELEGATE"; - default: - return "UNKNOWN"; - } -} - -/** - * StakeAuthorization defines authorization for delegate/undelegate/redelegate. - * - * Since: cosmos-sdk 0.43 - */ -export interface StakeAuthorization { - /** - * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is - * empty, there is no spend limit and any amount of coins can be delegated. - */ - max_tokens: Coin | undefined; - /** - * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's - * account. - */ - allow_list: StakeAuthorization_Validators | undefined; - /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ - deny_list: StakeAuthorization_Validators | undefined; - /** authorization_type defines one of AuthorizationType. */ - authorization_type: AuthorizationType; -} - -/** Validators defines list of validator addresses. */ -export interface StakeAuthorization_Validators { - address: string[]; -} - -const baseStakeAuthorization: object = { authorization_type: 0 }; - -export const StakeAuthorization = { - encode( - message: StakeAuthorization, - writer: Writer = Writer.create() - ): Writer { - if (message.max_tokens !== undefined) { - Coin.encode(message.max_tokens, writer.uint32(10).fork()).ldelim(); - } - if (message.allow_list !== undefined) { - StakeAuthorization_Validators.encode( - message.allow_list, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.deny_list !== undefined) { - StakeAuthorization_Validators.encode( - message.deny_list, - writer.uint32(26).fork() - ).ldelim(); - } - if (message.authorization_type !== 0) { - writer.uint32(32).int32(message.authorization_type); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): StakeAuthorization { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseStakeAuthorization } as StakeAuthorization; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_tokens = Coin.decode(reader, reader.uint32()); - break; - case 2: - message.allow_list = StakeAuthorization_Validators.decode( - reader, - reader.uint32() - ); - break; - case 3: - message.deny_list = StakeAuthorization_Validators.decode( - reader, - reader.uint32() - ); - break; - case 4: - message.authorization_type = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): StakeAuthorization { - const message = { ...baseStakeAuthorization } as StakeAuthorization; - if (object.max_tokens !== undefined && object.max_tokens !== null) { - message.max_tokens = Coin.fromJSON(object.max_tokens); - } else { - message.max_tokens = undefined; - } - if (object.allow_list !== undefined && object.allow_list !== null) { - message.allow_list = StakeAuthorization_Validators.fromJSON( - object.allow_list - ); - } else { - message.allow_list = undefined; - } - if (object.deny_list !== undefined && object.deny_list !== null) { - message.deny_list = StakeAuthorization_Validators.fromJSON( - object.deny_list - ); - } else { - message.deny_list = undefined; - } - if ( - object.authorization_type !== undefined && - object.authorization_type !== null - ) { - message.authorization_type = authorizationTypeFromJSON( - object.authorization_type - ); - } else { - message.authorization_type = 0; - } - return message; - }, - - toJSON(message: StakeAuthorization): unknown { - const obj: any = {}; - message.max_tokens !== undefined && - (obj.max_tokens = message.max_tokens - ? Coin.toJSON(message.max_tokens) - : undefined); - message.allow_list !== undefined && - (obj.allow_list = message.allow_list - ? StakeAuthorization_Validators.toJSON(message.allow_list) - : undefined); - message.deny_list !== undefined && - (obj.deny_list = message.deny_list - ? StakeAuthorization_Validators.toJSON(message.deny_list) - : undefined); - message.authorization_type !== undefined && - (obj.authorization_type = authorizationTypeToJSON( - message.authorization_type - )); - return obj; - }, - - fromPartial(object: DeepPartial): StakeAuthorization { - const message = { ...baseStakeAuthorization } as StakeAuthorization; - if (object.max_tokens !== undefined && object.max_tokens !== null) { - message.max_tokens = Coin.fromPartial(object.max_tokens); - } else { - message.max_tokens = undefined; - } - if (object.allow_list !== undefined && object.allow_list !== null) { - message.allow_list = StakeAuthorization_Validators.fromPartial( - object.allow_list - ); - } else { - message.allow_list = undefined; - } - if (object.deny_list !== undefined && object.deny_list !== null) { - message.deny_list = StakeAuthorization_Validators.fromPartial( - object.deny_list - ); - } else { - message.deny_list = undefined; - } - if ( - object.authorization_type !== undefined && - object.authorization_type !== null - ) { - message.authorization_type = object.authorization_type; - } else { - message.authorization_type = 0; - } - return message; - }, -}; - -const baseStakeAuthorization_Validators: object = { address: "" }; - -export const StakeAuthorization_Validators = { - encode( - message: StakeAuthorization_Validators, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.address) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): StakeAuthorization_Validators { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseStakeAuthorization_Validators, - } as StakeAuthorization_Validators; - message.address = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): StakeAuthorization_Validators { - const message = { - ...baseStakeAuthorization_Validators, - } as StakeAuthorization_Validators; - message.address = []; - if (object.address !== undefined && object.address !== null) { - for (const e of object.address) { - message.address.push(String(e)); - } - } - return message; - }, - - toJSON(message: StakeAuthorization_Validators): unknown { - const obj: any = {}; - if (message.address) { - obj.address = message.address.map((e) => e); - } else { - obj.address = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): StakeAuthorization_Validators { - const message = { - ...baseStakeAuthorization_Validators, - } as StakeAuthorization_Validators; - message.address = []; - if (object.address !== undefined && object.address !== null) { - for (const e of object.address) { - message.address.push(e); - } - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/genesis.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/genesis.ts deleted file mode 100644 index 9fdd3df2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/genesis.ts +++ /dev/null @@ -1,423 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - Params, - Validator, - Delegation, - UnbondingDelegation, - Redelegation, -} from "../../../cosmos/staking/v1beta1/staking"; - -export const protobufPackage = "cosmos.staking.v1beta1"; - -/** GenesisState defines the staking module's genesis state. */ -export interface GenesisState { - /** params defines all the paramaters of related to deposit. */ - params: Params | undefined; - /** - * last_total_power tracks the total amounts of bonded tokens recorded during - * the previous end block. - */ - last_total_power: Uint8Array; - /** - * last_validator_powers is a special index that provides a historical list - * of the last-block's bonded validators. - */ - last_validator_powers: LastValidatorPower[]; - /** delegations defines the validator set at genesis. */ - validators: Validator[]; - /** delegations defines the delegations active at genesis. */ - delegations: Delegation[]; - /** unbonding_delegations defines the unbonding delegations active at genesis. */ - unbonding_delegations: UnbondingDelegation[]; - /** redelegations defines the redelegations active at genesis. */ - redelegations: Redelegation[]; - exported: boolean; -} - -/** LastValidatorPower required for validator set update logic. */ -export interface LastValidatorPower { - /** address is the address of the validator. */ - address: string; - /** power defines the power of the validator. */ - power: number; -} - -const baseGenesisState: object = { exported: false }; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - if (message.last_total_power.length !== 0) { - writer.uint32(18).bytes(message.last_total_power); - } - for (const v of message.last_validator_powers) { - LastValidatorPower.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.validators) { - Validator.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.delegations) { - Delegation.encode(v!, writer.uint32(42).fork()).ldelim(); - } - for (const v of message.unbonding_delegations) { - UnbondingDelegation.encode(v!, writer.uint32(50).fork()).ldelim(); - } - for (const v of message.redelegations) { - Redelegation.encode(v!, writer.uint32(58).fork()).ldelim(); - } - if (message.exported === true) { - writer.uint32(64).bool(message.exported); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.last_validator_powers = []; - message.validators = []; - message.delegations = []; - message.unbonding_delegations = []; - message.redelegations = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - case 2: - message.last_total_power = reader.bytes(); - break; - case 3: - message.last_validator_powers.push( - LastValidatorPower.decode(reader, reader.uint32()) - ); - break; - case 4: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; - case 5: - message.delegations.push(Delegation.decode(reader, reader.uint32())); - break; - case 6: - message.unbonding_delegations.push( - UnbondingDelegation.decode(reader, reader.uint32()) - ); - break; - case 7: - message.redelegations.push( - Redelegation.decode(reader, reader.uint32()) - ); - break; - case 8: - message.exported = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.last_validator_powers = []; - message.validators = []; - message.delegations = []; - message.unbonding_delegations = []; - message.redelegations = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if ( - object.last_total_power !== undefined && - object.last_total_power !== null - ) { - message.last_total_power = bytesFromBase64(object.last_total_power); - } - if ( - object.last_validator_powers !== undefined && - object.last_validator_powers !== null - ) { - for (const e of object.last_validator_powers) { - message.last_validator_powers.push(LastValidatorPower.fromJSON(e)); - } - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.delegations !== undefined && object.delegations !== null) { - for (const e of object.delegations) { - message.delegations.push(Delegation.fromJSON(e)); - } - } - if ( - object.unbonding_delegations !== undefined && - object.unbonding_delegations !== null - ) { - for (const e of object.unbonding_delegations) { - message.unbonding_delegations.push(UnbondingDelegation.fromJSON(e)); - } - } - if (object.redelegations !== undefined && object.redelegations !== null) { - for (const e of object.redelegations) { - message.redelegations.push(Redelegation.fromJSON(e)); - } - } - if (object.exported !== undefined && object.exported !== null) { - message.exported = Boolean(object.exported); - } else { - message.exported = false; - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - message.last_total_power !== undefined && - (obj.last_total_power = base64FromBytes( - message.last_total_power !== undefined - ? message.last_total_power - : new Uint8Array() - )); - if (message.last_validator_powers) { - obj.last_validator_powers = message.last_validator_powers.map((e) => - e ? LastValidatorPower.toJSON(e) : undefined - ); - } else { - obj.last_validator_powers = []; - } - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - if (message.delegations) { - obj.delegations = message.delegations.map((e) => - e ? Delegation.toJSON(e) : undefined - ); - } else { - obj.delegations = []; - } - if (message.unbonding_delegations) { - obj.unbonding_delegations = message.unbonding_delegations.map((e) => - e ? UnbondingDelegation.toJSON(e) : undefined - ); - } else { - obj.unbonding_delegations = []; - } - if (message.redelegations) { - obj.redelegations = message.redelegations.map((e) => - e ? Redelegation.toJSON(e) : undefined - ); - } else { - obj.redelegations = []; - } - message.exported !== undefined && (obj.exported = message.exported); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.last_validator_powers = []; - message.validators = []; - message.delegations = []; - message.unbonding_delegations = []; - message.redelegations = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if ( - object.last_total_power !== undefined && - object.last_total_power !== null - ) { - message.last_total_power = object.last_total_power; - } else { - message.last_total_power = new Uint8Array(); - } - if ( - object.last_validator_powers !== undefined && - object.last_validator_powers !== null - ) { - for (const e of object.last_validator_powers) { - message.last_validator_powers.push(LastValidatorPower.fromPartial(e)); - } - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.delegations !== undefined && object.delegations !== null) { - for (const e of object.delegations) { - message.delegations.push(Delegation.fromPartial(e)); - } - } - if ( - object.unbonding_delegations !== undefined && - object.unbonding_delegations !== null - ) { - for (const e of object.unbonding_delegations) { - message.unbonding_delegations.push(UnbondingDelegation.fromPartial(e)); - } - } - if (object.redelegations !== undefined && object.redelegations !== null) { - for (const e of object.redelegations) { - message.redelegations.push(Redelegation.fromPartial(e)); - } - } - if (object.exported !== undefined && object.exported !== null) { - message.exported = object.exported; - } else { - message.exported = false; - } - return message; - }, -}; - -const baseLastValidatorPower: object = { address: "", power: 0 }; - -export const LastValidatorPower = { - encode( - message: LastValidatorPower, - writer: Writer = Writer.create() - ): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.power !== 0) { - writer.uint32(16).int64(message.power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): LastValidatorPower { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLastValidatorPower } as LastValidatorPower; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LastValidatorPower { - const message = { ...baseLastValidatorPower } as LastValidatorPower; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.power !== undefined && object.power !== null) { - message.power = Number(object.power); - } else { - message.power = 0; - } - return message; - }, - - toJSON(message: LastValidatorPower): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.power !== undefined && (obj.power = message.power); - return obj; - }, - - fromPartial(object: DeepPartial): LastValidatorPower { - const message = { ...baseLastValidatorPower } as LastValidatorPower; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.power !== undefined && object.power !== null) { - message.power = object.power; - } else { - message.power = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/query.ts deleted file mode 100644 index 097be2e9..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/query.ts +++ /dev/null @@ -1,2941 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; -import { - Validator, - DelegationResponse, - UnbondingDelegation, - RedelegationResponse, - HistoricalInfo, - Pool, - Params, -} from "../../../cosmos/staking/v1beta1/staking"; - -export const protobufPackage = "cosmos.staking.v1beta1"; - -/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ -export interface QueryValidatorsRequest { - /** status enables to query for validators matching a given status. */ - status: string; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ -export interface QueryValidatorsResponse { - /** validators contains all the queried validators. */ - validators: Validator[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** QueryValidatorRequest is response type for the Query/Validator RPC method */ -export interface QueryValidatorRequest { - /** validator_addr defines the validator address to query for. */ - validator_addr: string; -} - -/** QueryValidatorResponse is response type for the Query/Validator RPC method */ -export interface QueryValidatorResponse { - /** validator defines the the validator info. */ - validator: Validator | undefined; -} - -/** - * QueryValidatorDelegationsRequest is request type for the - * Query/ValidatorDelegations RPC method - */ -export interface QueryValidatorDelegationsRequest { - /** validator_addr defines the validator address to query for. */ - validator_addr: string; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryValidatorDelegationsResponse is response type for the - * Query/ValidatorDelegations RPC method - */ -export interface QueryValidatorDelegationsResponse { - delegation_responses: DelegationResponse[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** - * QueryValidatorUnbondingDelegationsRequest is required type for the - * Query/ValidatorUnbondingDelegations RPC method - */ -export interface QueryValidatorUnbondingDelegationsRequest { - /** validator_addr defines the validator address to query for. */ - validator_addr: string; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryValidatorUnbondingDelegationsResponse is response type for the - * Query/ValidatorUnbondingDelegations RPC method. - */ -export interface QueryValidatorUnbondingDelegationsResponse { - unbonding_responses: UnbondingDelegation[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ -export interface QueryDelegationRequest { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; - /** validator_addr defines the validator address to query for. */ - validator_addr: string; -} - -/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ -export interface QueryDelegationResponse { - /** delegation_responses defines the delegation info of a delegation. */ - delegation_response: DelegationResponse | undefined; -} - -/** - * QueryUnbondingDelegationRequest is request type for the - * Query/UnbondingDelegation RPC method. - */ -export interface QueryUnbondingDelegationRequest { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; - /** validator_addr defines the validator address to query for. */ - validator_addr: string; -} - -/** - * QueryDelegationResponse is response type for the Query/UnbondingDelegation - * RPC method. - */ -export interface QueryUnbondingDelegationResponse { - /** unbond defines the unbonding information of a delegation. */ - unbond: UnbondingDelegation | undefined; -} - -/** - * QueryDelegatorDelegationsRequest is request type for the - * Query/DelegatorDelegations RPC method. - */ -export interface QueryDelegatorDelegationsRequest { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryDelegatorDelegationsResponse is response type for the - * Query/DelegatorDelegations RPC method. - */ -export interface QueryDelegatorDelegationsResponse { - /** delegation_responses defines all the delegations' info of a delegator. */ - delegation_responses: DelegationResponse[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** - * QueryDelegatorUnbondingDelegationsRequest is request type for the - * Query/DelegatorUnbondingDelegations RPC method. - */ -export interface QueryDelegatorUnbondingDelegationsRequest { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryUnbondingDelegatorDelegationsResponse is response type for the - * Query/UnbondingDelegatorDelegations RPC method. - */ -export interface QueryDelegatorUnbondingDelegationsResponse { - unbonding_responses: UnbondingDelegation[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** - * QueryRedelegationsRequest is request type for the Query/Redelegations RPC - * method. - */ -export interface QueryRedelegationsRequest { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; - /** src_validator_addr defines the validator address to redelegate from. */ - src_validator_addr: string; - /** dst_validator_addr defines the validator address to redelegate to. */ - dst_validator_addr: string; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryRedelegationsResponse is response type for the Query/Redelegations RPC - * method. - */ -export interface QueryRedelegationsResponse { - redelegation_responses: RedelegationResponse[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** - * QueryDelegatorValidatorsRequest is request type for the - * Query/DelegatorValidators RPC method. - */ -export interface QueryDelegatorValidatorsRequest { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryDelegatorValidatorsResponse is response type for the - * Query/DelegatorValidators RPC method. - */ -export interface QueryDelegatorValidatorsResponse { - /** validators defines the the validators' info of a delegator. */ - validators: Validator[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** - * QueryDelegatorValidatorRequest is request type for the - * Query/DelegatorValidator RPC method. - */ -export interface QueryDelegatorValidatorRequest { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; - /** validator_addr defines the validator address to query for. */ - validator_addr: string; -} - -/** - * QueryDelegatorValidatorResponse response type for the - * Query/DelegatorValidator RPC method. - */ -export interface QueryDelegatorValidatorResponse { - /** validator defines the the validator info. */ - validator: Validator | undefined; -} - -/** - * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC - * method. - */ -export interface QueryHistoricalInfoRequest { - /** height defines at which height to query the historical info. */ - height: number; -} - -/** - * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC - * method. - */ -export interface QueryHistoricalInfoResponse { - /** hist defines the historical info at the given height. */ - hist: HistoricalInfo | undefined; -} - -/** QueryPoolRequest is request type for the Query/Pool RPC method. */ -export interface QueryPoolRequest {} - -/** QueryPoolResponse is response type for the Query/Pool RPC method. */ -export interface QueryPoolResponse { - /** pool defines the pool info. */ - pool: Pool | undefined; -} - -/** QueryParamsRequest is request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} - -/** QueryParamsResponse is response type for the Query/Params RPC method. */ -export interface QueryParamsResponse { - /** params holds all the parameters of this module. */ - params: Params | undefined; -} - -const baseQueryValidatorsRequest: object = { status: "" }; - -export const QueryValidatorsRequest = { - encode( - message: QueryValidatorsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.status !== "") { - writer.uint32(10).string(message.status); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryValidatorsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryValidatorsRequest } as QueryValidatorsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.status = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorsRequest { - const message = { ...baseQueryValidatorsRequest } as QueryValidatorsRequest; - if (object.status !== undefined && object.status !== null) { - message.status = String(object.status); - } else { - message.status = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorsRequest): unknown { - const obj: any = {}; - message.status !== undefined && (obj.status = message.status); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorsRequest { - const message = { ...baseQueryValidatorsRequest } as QueryValidatorsRequest; - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } else { - message.status = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryValidatorsResponse: object = {}; - -export const QueryValidatorsResponse = { - encode( - message: QueryValidatorsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.validators) { - Validator.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryValidatorsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorsResponse, - } as QueryValidatorsResponse; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validators.push(Validator.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): QueryValidatorsResponse { - const message = { - ...baseQueryValidatorsResponse, - } as QueryValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorsResponse): unknown { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorsResponse { - const message = { - ...baseQueryValidatorsResponse, - } as QueryValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryValidatorRequest: object = { validator_addr: "" }; - -export const QueryValidatorRequest = { - encode( - message: QueryValidatorRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_addr !== "") { - writer.uint32(10).string(message.validator_addr); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryValidatorRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryValidatorRequest } as QueryValidatorRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_addr = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorRequest { - const message = { ...baseQueryValidatorRequest } as QueryValidatorRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; - }, - - toJSON(message: QueryValidatorRequest): unknown { - const obj: any = {}; - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorRequest { - const message = { ...baseQueryValidatorRequest } as QueryValidatorRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } - return message; - }, -}; - -const baseQueryValidatorResponse: object = {}; - -export const QueryValidatorResponse = { - encode( - message: QueryValidatorResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.validator !== undefined) { - Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryValidatorResponse } as QueryValidatorResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator = Validator.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorResponse { - const message = { ...baseQueryValidatorResponse } as QueryValidatorResponse; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromJSON(object.validator); - } else { - message.validator = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorResponse): unknown { - const obj: any = {}; - message.validator !== undefined && - (obj.validator = message.validator - ? Validator.toJSON(message.validator) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorResponse { - const message = { ...baseQueryValidatorResponse } as QueryValidatorResponse; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromPartial(object.validator); - } else { - message.validator = undefined; - } - return message; - }, -}; - -const baseQueryValidatorDelegationsRequest: object = { validator_addr: "" }; - -export const QueryValidatorDelegationsRequest = { - encode( - message: QueryValidatorDelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_addr !== "") { - writer.uint32(10).string(message.validator_addr); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorDelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorDelegationsRequest, - } as QueryValidatorDelegationsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_addr = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorDelegationsRequest { - const message = { - ...baseQueryValidatorDelegationsRequest, - } as QueryValidatorDelegationsRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorDelegationsRequest): unknown { - const obj: any = {}; - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorDelegationsRequest { - const message = { - ...baseQueryValidatorDelegationsRequest, - } as QueryValidatorDelegationsRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryValidatorDelegationsResponse: object = {}; - -export const QueryValidatorDelegationsResponse = { - encode( - message: QueryValidatorDelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.delegation_responses) { - DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorDelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorDelegationsResponse, - } as QueryValidatorDelegationsResponse; - message.delegation_responses = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegation_responses.push( - DelegationResponse.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): QueryValidatorDelegationsResponse { - const message = { - ...baseQueryValidatorDelegationsResponse, - } as QueryValidatorDelegationsResponse; - message.delegation_responses = []; - if ( - object.delegation_responses !== undefined && - object.delegation_responses !== null - ) { - for (const e of object.delegation_responses) { - message.delegation_responses.push(DelegationResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorDelegationsResponse): unknown { - const obj: any = {}; - if (message.delegation_responses) { - obj.delegation_responses = message.delegation_responses.map((e) => - e ? DelegationResponse.toJSON(e) : undefined - ); - } else { - obj.delegation_responses = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorDelegationsResponse { - const message = { - ...baseQueryValidatorDelegationsResponse, - } as QueryValidatorDelegationsResponse; - message.delegation_responses = []; - if ( - object.delegation_responses !== undefined && - object.delegation_responses !== null - ) { - for (const e of object.delegation_responses) { - message.delegation_responses.push(DelegationResponse.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryValidatorUnbondingDelegationsRequest: object = { - validator_addr: "", -}; - -export const QueryValidatorUnbondingDelegationsRequest = { - encode( - message: QueryValidatorUnbondingDelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_addr !== "") { - writer.uint32(10).string(message.validator_addr); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorUnbondingDelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorUnbondingDelegationsRequest, - } as QueryValidatorUnbondingDelegationsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_addr = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorUnbondingDelegationsRequest { - const message = { - ...baseQueryValidatorUnbondingDelegationsRequest, - } as QueryValidatorUnbondingDelegationsRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorUnbondingDelegationsRequest): unknown { - const obj: any = {}; - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorUnbondingDelegationsRequest { - const message = { - ...baseQueryValidatorUnbondingDelegationsRequest, - } as QueryValidatorUnbondingDelegationsRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryValidatorUnbondingDelegationsResponse: object = {}; - -export const QueryValidatorUnbondingDelegationsResponse = { - encode( - message: QueryValidatorUnbondingDelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.unbonding_responses) { - UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorUnbondingDelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorUnbondingDelegationsResponse, - } as QueryValidatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.unbonding_responses.push( - UnbondingDelegation.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): QueryValidatorUnbondingDelegationsResponse { - const message = { - ...baseQueryValidatorUnbondingDelegationsResponse, - } as QueryValidatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - if ( - object.unbonding_responses !== undefined && - object.unbonding_responses !== null - ) { - for (const e of object.unbonding_responses) { - message.unbonding_responses.push(UnbondingDelegation.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorUnbondingDelegationsResponse): unknown { - const obj: any = {}; - if (message.unbonding_responses) { - obj.unbonding_responses = message.unbonding_responses.map((e) => - e ? UnbondingDelegation.toJSON(e) : undefined - ); - } else { - obj.unbonding_responses = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorUnbondingDelegationsResponse { - const message = { - ...baseQueryValidatorUnbondingDelegationsResponse, - } as QueryValidatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - if ( - object.unbonding_responses !== undefined && - object.unbonding_responses !== null - ) { - for (const e of object.unbonding_responses) { - message.unbonding_responses.push(UnbondingDelegation.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDelegationRequest: object = { - delegator_addr: "", - validator_addr: "", -}; - -export const QueryDelegationRequest = { - encode( - message: QueryDelegationRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); - } - if (message.validator_addr !== "") { - writer.uint32(18).string(message.validator_addr); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryDelegationRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDelegationRequest } as QueryDelegationRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_addr = reader.string(); - break; - case 2: - message.validator_addr = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegationRequest { - const message = { ...baseQueryDelegationRequest } as QueryDelegationRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; - }, - - toJSON(message: QueryDelegationRequest): unknown { - const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegationRequest { - const message = { ...baseQueryDelegationRequest } as QueryDelegationRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } - return message; - }, -}; - -const baseQueryDelegationResponse: object = {}; - -export const QueryDelegationResponse = { - encode( - message: QueryDelegationResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.delegation_response !== undefined) { - DelegationResponse.encode( - message.delegation_response, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryDelegationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationResponse, - } as QueryDelegationResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegation_response = DelegationResponse.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegationResponse { - const message = { - ...baseQueryDelegationResponse, - } as QueryDelegationResponse; - if ( - object.delegation_response !== undefined && - object.delegation_response !== null - ) { - message.delegation_response = DelegationResponse.fromJSON( - object.delegation_response - ); - } else { - message.delegation_response = undefined; - } - return message; - }, - - toJSON(message: QueryDelegationResponse): unknown { - const obj: any = {}; - message.delegation_response !== undefined && - (obj.delegation_response = message.delegation_response - ? DelegationResponse.toJSON(message.delegation_response) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegationResponse { - const message = { - ...baseQueryDelegationResponse, - } as QueryDelegationResponse; - if ( - object.delegation_response !== undefined && - object.delegation_response !== null - ) { - message.delegation_response = DelegationResponse.fromPartial( - object.delegation_response - ); - } else { - message.delegation_response = undefined; - } - return message; - }, -}; - -const baseQueryUnbondingDelegationRequest: object = { - delegator_addr: "", - validator_addr: "", -}; - -export const QueryUnbondingDelegationRequest = { - encode( - message: QueryUnbondingDelegationRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); - } - if (message.validator_addr !== "") { - writer.uint32(18).string(message.validator_addr); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUnbondingDelegationRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUnbondingDelegationRequest, - } as QueryUnbondingDelegationRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_addr = reader.string(); - break; - case 2: - message.validator_addr = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUnbondingDelegationRequest { - const message = { - ...baseQueryUnbondingDelegationRequest, - } as QueryUnbondingDelegationRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; - }, - - toJSON(message: QueryUnbondingDelegationRequest): unknown { - const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUnbondingDelegationRequest { - const message = { - ...baseQueryUnbondingDelegationRequest, - } as QueryUnbondingDelegationRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } - return message; - }, -}; - -const baseQueryUnbondingDelegationResponse: object = {}; - -export const QueryUnbondingDelegationResponse = { - encode( - message: QueryUnbondingDelegationResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.unbond !== undefined) { - UnbondingDelegation.encode( - message.unbond, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUnbondingDelegationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUnbondingDelegationResponse, - } as QueryUnbondingDelegationResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.unbond = UnbondingDelegation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUnbondingDelegationResponse { - const message = { - ...baseQueryUnbondingDelegationResponse, - } as QueryUnbondingDelegationResponse; - if (object.unbond !== undefined && object.unbond !== null) { - message.unbond = UnbondingDelegation.fromJSON(object.unbond); - } else { - message.unbond = undefined; - } - return message; - }, - - toJSON(message: QueryUnbondingDelegationResponse): unknown { - const obj: any = {}; - message.unbond !== undefined && - (obj.unbond = message.unbond - ? UnbondingDelegation.toJSON(message.unbond) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUnbondingDelegationResponse { - const message = { - ...baseQueryUnbondingDelegationResponse, - } as QueryUnbondingDelegationResponse; - if (object.unbond !== undefined && object.unbond !== null) { - message.unbond = UnbondingDelegation.fromPartial(object.unbond); - } else { - message.unbond = undefined; - } - return message; - }, -}; - -const baseQueryDelegatorDelegationsRequest: object = { delegator_addr: "" }; - -export const QueryDelegatorDelegationsRequest = { - encode( - message: QueryDelegatorDelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorDelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorDelegationsRequest, - } as QueryDelegatorDelegationsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_addr = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegatorDelegationsRequest { - const message = { - ...baseQueryDelegatorDelegationsRequest, - } as QueryDelegatorDelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDelegatorDelegationsRequest): unknown { - const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorDelegationsRequest { - const message = { - ...baseQueryDelegatorDelegationsRequest, - } as QueryDelegatorDelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDelegatorDelegationsResponse: object = {}; - -export const QueryDelegatorDelegationsResponse = { - encode( - message: QueryDelegatorDelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.delegation_responses) { - DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorDelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorDelegationsResponse, - } as QueryDelegatorDelegationsResponse; - message.delegation_responses = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegation_responses.push( - DelegationResponse.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): QueryDelegatorDelegationsResponse { - const message = { - ...baseQueryDelegatorDelegationsResponse, - } as QueryDelegatorDelegationsResponse; - message.delegation_responses = []; - if ( - object.delegation_responses !== undefined && - object.delegation_responses !== null - ) { - for (const e of object.delegation_responses) { - message.delegation_responses.push(DelegationResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDelegatorDelegationsResponse): unknown { - const obj: any = {}; - if (message.delegation_responses) { - obj.delegation_responses = message.delegation_responses.map((e) => - e ? DelegationResponse.toJSON(e) : undefined - ); - } else { - obj.delegation_responses = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorDelegationsResponse { - const message = { - ...baseQueryDelegatorDelegationsResponse, - } as QueryDelegatorDelegationsResponse; - message.delegation_responses = []; - if ( - object.delegation_responses !== undefined && - object.delegation_responses !== null - ) { - for (const e of object.delegation_responses) { - message.delegation_responses.push(DelegationResponse.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDelegatorUnbondingDelegationsRequest: object = { - delegator_addr: "", -}; - -export const QueryDelegatorUnbondingDelegationsRequest = { - encode( - message: QueryDelegatorUnbondingDelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorUnbondingDelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorUnbondingDelegationsRequest, - } as QueryDelegatorUnbondingDelegationsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_addr = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegatorUnbondingDelegationsRequest { - const message = { - ...baseQueryDelegatorUnbondingDelegationsRequest, - } as QueryDelegatorUnbondingDelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDelegatorUnbondingDelegationsRequest): unknown { - const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorUnbondingDelegationsRequest { - const message = { - ...baseQueryDelegatorUnbondingDelegationsRequest, - } as QueryDelegatorUnbondingDelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDelegatorUnbondingDelegationsResponse: object = {}; - -export const QueryDelegatorUnbondingDelegationsResponse = { - encode( - message: QueryDelegatorUnbondingDelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.unbonding_responses) { - UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorUnbondingDelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorUnbondingDelegationsResponse, - } as QueryDelegatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.unbonding_responses.push( - UnbondingDelegation.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): QueryDelegatorUnbondingDelegationsResponse { - const message = { - ...baseQueryDelegatorUnbondingDelegationsResponse, - } as QueryDelegatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - if ( - object.unbonding_responses !== undefined && - object.unbonding_responses !== null - ) { - for (const e of object.unbonding_responses) { - message.unbonding_responses.push(UnbondingDelegation.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDelegatorUnbondingDelegationsResponse): unknown { - const obj: any = {}; - if (message.unbonding_responses) { - obj.unbonding_responses = message.unbonding_responses.map((e) => - e ? UnbondingDelegation.toJSON(e) : undefined - ); - } else { - obj.unbonding_responses = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorUnbondingDelegationsResponse { - const message = { - ...baseQueryDelegatorUnbondingDelegationsResponse, - } as QueryDelegatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - if ( - object.unbonding_responses !== undefined && - object.unbonding_responses !== null - ) { - for (const e of object.unbonding_responses) { - message.unbonding_responses.push(UnbondingDelegation.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryRedelegationsRequest: object = { - delegator_addr: "", - src_validator_addr: "", - dst_validator_addr: "", -}; - -export const QueryRedelegationsRequest = { - encode( - message: QueryRedelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); - } - if (message.src_validator_addr !== "") { - writer.uint32(18).string(message.src_validator_addr); - } - if (message.dst_validator_addr !== "") { - writer.uint32(26).string(message.dst_validator_addr); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryRedelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryRedelegationsRequest, - } as QueryRedelegationsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_addr = reader.string(); - break; - case 2: - message.src_validator_addr = reader.string(); - break; - case 3: - message.dst_validator_addr = reader.string(); - break; - case 4: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryRedelegationsRequest { - const message = { - ...baseQueryRedelegationsRequest, - } as QueryRedelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if ( - object.src_validator_addr !== undefined && - object.src_validator_addr !== null - ) { - message.src_validator_addr = String(object.src_validator_addr); - } else { - message.src_validator_addr = ""; - } - if ( - object.dst_validator_addr !== undefined && - object.dst_validator_addr !== null - ) { - message.dst_validator_addr = String(object.dst_validator_addr); - } else { - message.dst_validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryRedelegationsRequest): unknown { - const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.src_validator_addr !== undefined && - (obj.src_validator_addr = message.src_validator_addr); - message.dst_validator_addr !== undefined && - (obj.dst_validator_addr = message.dst_validator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryRedelegationsRequest { - const message = { - ...baseQueryRedelegationsRequest, - } as QueryRedelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if ( - object.src_validator_addr !== undefined && - object.src_validator_addr !== null - ) { - message.src_validator_addr = object.src_validator_addr; - } else { - message.src_validator_addr = ""; - } - if ( - object.dst_validator_addr !== undefined && - object.dst_validator_addr !== null - ) { - message.dst_validator_addr = object.dst_validator_addr; - } else { - message.dst_validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryRedelegationsResponse: object = {}; - -export const QueryRedelegationsResponse = { - encode( - message: QueryRedelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.redelegation_responses) { - RedelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryRedelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryRedelegationsResponse, - } as QueryRedelegationsResponse; - message.redelegation_responses = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.redelegation_responses.push( - RedelegationResponse.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): QueryRedelegationsResponse { - const message = { - ...baseQueryRedelegationsResponse, - } as QueryRedelegationsResponse; - message.redelegation_responses = []; - if ( - object.redelegation_responses !== undefined && - object.redelegation_responses !== null - ) { - for (const e of object.redelegation_responses) { - message.redelegation_responses.push(RedelegationResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryRedelegationsResponse): unknown { - const obj: any = {}; - if (message.redelegation_responses) { - obj.redelegation_responses = message.redelegation_responses.map((e) => - e ? RedelegationResponse.toJSON(e) : undefined - ); - } else { - obj.redelegation_responses = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryRedelegationsResponse { - const message = { - ...baseQueryRedelegationsResponse, - } as QueryRedelegationsResponse; - message.redelegation_responses = []; - if ( - object.redelegation_responses !== undefined && - object.redelegation_responses !== null - ) { - for (const e of object.redelegation_responses) { - message.redelegation_responses.push( - RedelegationResponse.fromPartial(e) - ); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDelegatorValidatorsRequest: object = { delegator_addr: "" }; - -export const QueryDelegatorValidatorsRequest = { - encode( - message: QueryDelegatorValidatorsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_addr = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegatorValidatorsRequest { - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDelegatorValidatorsRequest): unknown { - const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorValidatorsRequest { - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDelegatorValidatorsResponse: object = {}; - -export const QueryDelegatorValidatorsResponse = { - encode( - message: QueryDelegatorValidatorsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.validators) { - Validator.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validators.push(Validator.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): QueryDelegatorValidatorsResponse { - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDelegatorValidatorsResponse): unknown { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorValidatorsResponse { - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDelegatorValidatorRequest: object = { - delegator_addr: "", - validator_addr: "", -}; - -export const QueryDelegatorValidatorRequest = { - encode( - message: QueryDelegatorValidatorRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); - } - if (message.validator_addr !== "") { - writer.uint32(18).string(message.validator_addr); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorRequest, - } as QueryDelegatorValidatorRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_addr = reader.string(); - break; - case 2: - message.validator_addr = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegatorValidatorRequest { - const message = { - ...baseQueryDelegatorValidatorRequest, - } as QueryDelegatorValidatorRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; - }, - - toJSON(message: QueryDelegatorValidatorRequest): unknown { - const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorValidatorRequest { - const message = { - ...baseQueryDelegatorValidatorRequest, - } as QueryDelegatorValidatorRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } - return message; - }, -}; - -const baseQueryDelegatorValidatorResponse: object = {}; - -export const QueryDelegatorValidatorResponse = { - encode( - message: QueryDelegatorValidatorResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.validator !== undefined) { - Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorResponse, - } as QueryDelegatorValidatorResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator = Validator.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDelegatorValidatorResponse { - const message = { - ...baseQueryDelegatorValidatorResponse, - } as QueryDelegatorValidatorResponse; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromJSON(object.validator); - } else { - message.validator = undefined; - } - return message; - }, - - toJSON(message: QueryDelegatorValidatorResponse): unknown { - const obj: any = {}; - message.validator !== undefined && - (obj.validator = message.validator - ? Validator.toJSON(message.validator) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDelegatorValidatorResponse { - const message = { - ...baseQueryDelegatorValidatorResponse, - } as QueryDelegatorValidatorResponse; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromPartial(object.validator); - } else { - message.validator = undefined; - } - return message; - }, -}; - -const baseQueryHistoricalInfoRequest: object = { height: 0 }; - -export const QueryHistoricalInfoRequest = { - encode( - message: QueryHistoricalInfoRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryHistoricalInfoRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryHistoricalInfoRequest, - } as QueryHistoricalInfoRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryHistoricalInfoRequest { - const message = { - ...baseQueryHistoricalInfoRequest, - } as QueryHistoricalInfoRequest; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; - }, - - toJSON(message: QueryHistoricalInfoRequest): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryHistoricalInfoRequest { - const message = { - ...baseQueryHistoricalInfoRequest, - } as QueryHistoricalInfoRequest; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - return message; - }, -}; - -const baseQueryHistoricalInfoResponse: object = {}; - -export const QueryHistoricalInfoResponse = { - encode( - message: QueryHistoricalInfoResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.hist !== undefined) { - HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryHistoricalInfoResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryHistoricalInfoResponse, - } as QueryHistoricalInfoResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hist = HistoricalInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryHistoricalInfoResponse { - const message = { - ...baseQueryHistoricalInfoResponse, - } as QueryHistoricalInfoResponse; - if (object.hist !== undefined && object.hist !== null) { - message.hist = HistoricalInfo.fromJSON(object.hist); - } else { - message.hist = undefined; - } - return message; - }, - - toJSON(message: QueryHistoricalInfoResponse): unknown { - const obj: any = {}; - message.hist !== undefined && - (obj.hist = message.hist - ? HistoricalInfo.toJSON(message.hist) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryHistoricalInfoResponse { - const message = { - ...baseQueryHistoricalInfoResponse, - } as QueryHistoricalInfoResponse; - if (object.hist !== undefined && object.hist !== null) { - message.hist = HistoricalInfo.fromPartial(object.hist); - } else { - message.hist = undefined; - } - return message; - }, -}; - -const baseQueryPoolRequest: object = {}; - -export const QueryPoolRequest = { - encode(_: QueryPoolRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryPoolRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryPoolRequest } as QueryPoolRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryPoolRequest { - const message = { ...baseQueryPoolRequest } as QueryPoolRequest; - return message; - }, - - toJSON(_: QueryPoolRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryPoolRequest { - const message = { ...baseQueryPoolRequest } as QueryPoolRequest; - return message; - }, -}; - -const baseQueryPoolResponse: object = {}; - -export const QueryPoolResponse = { - encode(message: QueryPoolResponse, writer: Writer = Writer.create()): Writer { - if (message.pool !== undefined) { - Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryPoolResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryPoolResponse } as QueryPoolResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pool = Pool.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPoolResponse { - const message = { ...baseQueryPoolResponse } as QueryPoolResponse; - if (object.pool !== undefined && object.pool !== null) { - message.pool = Pool.fromJSON(object.pool); - } else { - message.pool = undefined; - } - return message; - }, - - toJSON(message: QueryPoolResponse): unknown { - const obj: any = {}; - message.pool !== undefined && - (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryPoolResponse { - const message = { ...baseQueryPoolResponse } as QueryPoolResponse; - if (object.pool !== undefined && object.pool !== null) { - message.pool = Pool.fromPartial(object.pool); - } else { - message.pool = undefined; - } - return message; - }, -}; - -const baseQueryParamsRequest: object = {}; - -export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, - - toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, -}; - -const baseQueryParamsResponse: object = {}; - -export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - 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): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -/** Query defines the gRPC querier service. */ -export interface Query { - /** Validators queries all validators that match the given status. */ - Validators(request: QueryValidatorsRequest): Promise; - /** Validator queries validator info for given validator address. */ - Validator(request: QueryValidatorRequest): Promise; - /** ValidatorDelegations queries delegate info for given validator. */ - ValidatorDelegations( - request: QueryValidatorDelegationsRequest - ): Promise; - /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ - ValidatorUnbondingDelegations( - request: QueryValidatorUnbondingDelegationsRequest - ): Promise; - /** Delegation queries delegate info for given validator delegator pair. */ - Delegation(request: QueryDelegationRequest): Promise; - /** - * UnbondingDelegation queries unbonding info for given validator delegator - * pair. - */ - UnbondingDelegation( - request: QueryUnbondingDelegationRequest - ): Promise; - /** DelegatorDelegations queries all delegations of a given delegator address. */ - DelegatorDelegations( - request: QueryDelegatorDelegationsRequest - ): Promise; - /** - * DelegatorUnbondingDelegations queries all unbonding delegations of a given - * delegator address. - */ - DelegatorUnbondingDelegations( - request: QueryDelegatorUnbondingDelegationsRequest - ): Promise; - /** Redelegations queries redelegations of given address. */ - Redelegations( - request: QueryRedelegationsRequest - ): Promise; - /** - * DelegatorValidators queries all validators info for given delegator - * address. - */ - DelegatorValidators( - request: QueryDelegatorValidatorsRequest - ): Promise; - /** - * DelegatorValidator queries validator info for given delegator validator - * pair. - */ - DelegatorValidator( - request: QueryDelegatorValidatorRequest - ): Promise; - /** HistoricalInfo queries the historical info for given height. */ - HistoricalInfo( - request: QueryHistoricalInfoRequest - ): Promise; - /** Pool queries the pool info. */ - Pool(request: QueryPoolRequest): Promise; - /** Parameters queries the staking parameters. */ - Params(request: QueryParamsRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Validators( - request: QueryValidatorsRequest - ): Promise { - const data = QueryValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Validators", - data - ); - return promise.then((data) => - QueryValidatorsResponse.decode(new Reader(data)) - ); - } - - Validator(request: QueryValidatorRequest): Promise { - const data = QueryValidatorRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Validator", - data - ); - return promise.then((data) => - QueryValidatorResponse.decode(new Reader(data)) - ); - } - - ValidatorDelegations( - request: QueryValidatorDelegationsRequest - ): Promise { - const data = QueryValidatorDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "ValidatorDelegations", - data - ); - return promise.then((data) => - QueryValidatorDelegationsResponse.decode(new Reader(data)) - ); - } - - ValidatorUnbondingDelegations( - request: QueryValidatorUnbondingDelegationsRequest - ): Promise { - const data = QueryValidatorUnbondingDelegationsRequest.encode( - request - ).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "ValidatorUnbondingDelegations", - data - ); - return promise.then((data) => - QueryValidatorUnbondingDelegationsResponse.decode(new Reader(data)) - ); - } - - Delegation( - request: QueryDelegationRequest - ): Promise { - const data = QueryDelegationRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Delegation", - data - ); - return promise.then((data) => - QueryDelegationResponse.decode(new Reader(data)) - ); - } - - UnbondingDelegation( - request: QueryUnbondingDelegationRequest - ): Promise { - const data = QueryUnbondingDelegationRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "UnbondingDelegation", - data - ); - return promise.then((data) => - QueryUnbondingDelegationResponse.decode(new Reader(data)) - ); - } - - DelegatorDelegations( - request: QueryDelegatorDelegationsRequest - ): Promise { - const data = QueryDelegatorDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "DelegatorDelegations", - data - ); - return promise.then((data) => - QueryDelegatorDelegationsResponse.decode(new Reader(data)) - ); - } - - DelegatorUnbondingDelegations( - request: QueryDelegatorUnbondingDelegationsRequest - ): Promise { - const data = QueryDelegatorUnbondingDelegationsRequest.encode( - request - ).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "DelegatorUnbondingDelegations", - data - ); - return promise.then((data) => - QueryDelegatorUnbondingDelegationsResponse.decode(new Reader(data)) - ); - } - - Redelegations( - request: QueryRedelegationsRequest - ): Promise { - const data = QueryRedelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Redelegations", - data - ); - return promise.then((data) => - QueryRedelegationsResponse.decode(new Reader(data)) - ); - } - - DelegatorValidators( - request: QueryDelegatorValidatorsRequest - ): Promise { - const data = QueryDelegatorValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "DelegatorValidators", - data - ); - return promise.then((data) => - QueryDelegatorValidatorsResponse.decode(new Reader(data)) - ); - } - - DelegatorValidator( - request: QueryDelegatorValidatorRequest - ): Promise { - const data = QueryDelegatorValidatorRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "DelegatorValidator", - data - ); - return promise.then((data) => - QueryDelegatorValidatorResponse.decode(new Reader(data)) - ); - } - - HistoricalInfo( - request: QueryHistoricalInfoRequest - ): Promise { - const data = QueryHistoricalInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "HistoricalInfo", - data - ); - return promise.then((data) => - QueryHistoricalInfoResponse.decode(new Reader(data)) - ); - } - - Pool(request: QueryPoolRequest): Promise { - const data = QueryPoolRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Pool", - data - ); - return promise.then((data) => QueryPoolResponse.decode(new Reader(data))); - } - - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/staking.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/staking.ts deleted file mode 100644 index 924ca229..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/staking.ts +++ /dev/null @@ -1,2607 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Header } from "../../../tendermint/types/types"; -import { Any } from "../../../google/protobuf/any"; -import { Duration } from "../../../google/protobuf/duration"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmos.staking.v1beta1"; - -/** BondStatus is the status of a validator. */ -export enum BondStatus { - /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ - BOND_STATUS_UNSPECIFIED = 0, - /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. */ - BOND_STATUS_UNBONDED = 1, - /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. */ - BOND_STATUS_UNBONDING = 2, - /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */ - BOND_STATUS_BONDED = 3, - UNRECOGNIZED = -1, -} - -export function bondStatusFromJSON(object: any): BondStatus { - switch (object) { - case 0: - case "BOND_STATUS_UNSPECIFIED": - return BondStatus.BOND_STATUS_UNSPECIFIED; - case 1: - case "BOND_STATUS_UNBONDED": - return BondStatus.BOND_STATUS_UNBONDED; - case 2: - case "BOND_STATUS_UNBONDING": - return BondStatus.BOND_STATUS_UNBONDING; - case 3: - case "BOND_STATUS_BONDED": - return BondStatus.BOND_STATUS_BONDED; - case -1: - case "UNRECOGNIZED": - default: - return BondStatus.UNRECOGNIZED; - } -} - -export function bondStatusToJSON(object: BondStatus): string { - switch (object) { - case BondStatus.BOND_STATUS_UNSPECIFIED: - return "BOND_STATUS_UNSPECIFIED"; - case BondStatus.BOND_STATUS_UNBONDED: - return "BOND_STATUS_UNBONDED"; - case BondStatus.BOND_STATUS_UNBONDING: - return "BOND_STATUS_UNBONDING"; - case BondStatus.BOND_STATUS_BONDED: - return "BOND_STATUS_BONDED"; - default: - return "UNKNOWN"; - } -} - -/** - * HistoricalInfo contains header and validator information for a given block. - * It is stored as part of staking module's state, which persists the `n` most - * recent HistoricalInfo - * (`n` is set by the staking module's `historical_entries` parameter). - */ -export interface HistoricalInfo { - header: Header | undefined; - valset: Validator[]; -} - -/** - * CommissionRates defines the initial commission rates to be used for creating - * a validator. - */ -export interface CommissionRates { - /** rate is the commission rate charged to delegators, as a fraction. */ - rate: string; - /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ - max_rate: string; - /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ - max_change_rate: string; -} - -/** Commission defines commission parameters for a given validator. */ -export interface Commission { - /** commission_rates defines the initial commission rates to be used for creating a validator. */ - commission_rates: CommissionRates | undefined; - /** update_time is the last time the commission rate was changed. */ - update_time: Date | undefined; -} - -/** Description defines a validator description. */ -export interface Description { - /** moniker defines a human-readable name for the validator. */ - moniker: string; - /** identity defines an optional identity signature (ex. UPort or Keybase). */ - identity: string; - /** website defines an optional website link. */ - website: string; - /** security_contact defines an optional email for security contact. */ - security_contact: string; - /** details define other optional details. */ - details: string; -} - -/** - * Validator defines a validator, together with the total amount of the - * Validator's bond shares and their exchange rate to coins. Slashing results in - * a decrease in the exchange rate, allowing correct calculation of future - * undelegations without iterating over delegators. When coins are delegated to - * this validator, the validator is credited with a delegation whose number of - * bond shares is based on the amount of coins delegated divided by the current - * exchange rate. Voting power can be calculated as total bonded shares - * multiplied by exchange rate. - */ -export interface Validator { - /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ - operator_address: string; - /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ - consensus_pubkey: Any | undefined; - /** jailed defined whether the validator has been jailed from bonded status or not. */ - jailed: boolean; - /** status is the validator status (bonded/unbonding/unbonded). */ - status: BondStatus; - /** tokens define the delegated tokens (incl. self-delegation). */ - tokens: string; - /** delegator_shares defines total shares issued to a validator's delegators. */ - delegator_shares: string; - /** description defines the description terms for the validator. */ - description: Description | undefined; - /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ - unbonding_height: number; - /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbonding_time: Date | undefined; - /** commission defines the commission parameters. */ - commission: Commission | undefined; - /** min_self_delegation is the validator's self declared minimum self delegation. */ - min_self_delegation: string; -} - -/** ValAddresses defines a repeated set of validator addresses. */ -export interface ValAddresses { - addresses: string[]; -} - -/** - * DVPair is struct that just has a delegator-validator pair with no other data. - * It is intended to be used as a marshalable pointer. For example, a DVPair can - * be used to construct the key to getting an UnbondingDelegation from state. - */ -export interface DVPair { - delegator_address: string; - validator_address: string; -} - -/** DVPairs defines an array of DVPair objects. */ -export interface DVPairs { - pairs: DVPair[]; -} - -/** - * DVVTriplet is struct that just has a delegator-validator-validator triplet - * with no other data. It is intended to be used as a marshalable pointer. For - * example, a DVVTriplet can be used to construct the key to getting a - * Redelegation from state. - */ -export interface DVVTriplet { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; -} - -/** DVVTriplets defines an array of DVVTriplet objects. */ -export interface DVVTriplets { - triplets: DVVTriplet[]; -} - -/** - * Delegation represents the bond with tokens held by an account. It is - * owned by one delegator, and is associated with the voting power of one - * validator. - */ -export interface Delegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; - /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; - /** shares define the delegation shares received. */ - shares: string; -} - -/** - * UnbondingDelegation stores all of a single delegator's unbonding bonds - * for a single validator in an time-ordered list. - */ -export interface UnbondingDelegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; - /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; - /** entries are the unbonding delegation entries. */ - entries: UnbondingDelegationEntry[]; -} - -/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ -export interface UnbondingDelegationEntry { - /** creation_height is the height which the unbonding took place. */ - creation_height: number; - /** completion_time is the unix time for unbonding completion. */ - completion_time: Date | undefined; - /** initial_balance defines the tokens initially scheduled to receive at completion. */ - initial_balance: string; - /** balance defines the tokens to receive at completion. */ - balance: string; -} - -/** RedelegationEntry defines a redelegation object with relevant metadata. */ -export interface RedelegationEntry { - /** creation_height defines the height which the redelegation took place. */ - creation_height: number; - /** completion_time defines the unix time for redelegation completion. */ - completion_time: Date | undefined; - /** initial_balance defines the initial balance when redelegation started. */ - initial_balance: string; - /** shares_dst is the amount of destination-validator shares created by redelegation. */ - shares_dst: string; -} - -/** - * Redelegation contains the list of a particular delegator's redelegating bonds - * from a particular source validator to a particular destination validator. - */ -export interface Redelegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; - /** validator_src_address is the validator redelegation source operator address. */ - validator_src_address: string; - /** validator_dst_address is the validator redelegation destination operator address. */ - validator_dst_address: string; - /** entries are the redelegation entries. */ - entries: RedelegationEntry[]; -} - -/** Params defines the parameters for the staking module. */ -export interface Params { - /** unbonding_time is the time duration of unbonding. */ - unbonding_time: Duration | undefined; - /** max_validators is the maximum number of validators. */ - max_validators: number; - /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ - max_entries: number; - /** historical_entries is the number of historical entries to persist. */ - historical_entries: number; - /** bond_denom defines the bondable coin denomination. */ - bond_denom: string; -} - -/** - * DelegationResponse is equivalent to Delegation except that it contains a - * balance in addition to shares which is more suitable for client responses. - */ -export interface DelegationResponse { - delegation: Delegation | undefined; - balance: Coin | undefined; -} - -/** - * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it - * contains a balance in addition to shares which is more suitable for client - * responses. - */ -export interface RedelegationEntryResponse { - redelegation_entry: RedelegationEntry | undefined; - balance: string; -} - -/** - * RedelegationResponse is equivalent to a Redelegation except that its entries - * contain a balance in addition to shares which is more suitable for client - * responses. - */ -export interface RedelegationResponse { - redelegation: Redelegation | undefined; - entries: RedelegationEntryResponse[]; -} - -/** - * Pool is used for tracking bonded and not-bonded token supply of the bond - * denomination. - */ -export interface Pool { - not_bonded_tokens: string; - bonded_tokens: string; -} - -const baseHistoricalInfo: object = {}; - -export const HistoricalInfo = { - encode(message: HistoricalInfo, writer: Writer = Writer.create()): Writer { - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.valset) { - Validator.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HistoricalInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHistoricalInfo } as HistoricalInfo; - message.valset = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = Header.decode(reader, reader.uint32()); - break; - case 2: - message.valset.push(Validator.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HistoricalInfo { - const message = { ...baseHistoricalInfo } as HistoricalInfo; - message.valset = []; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.valset !== undefined && object.valset !== null) { - for (const e of object.valset) { - message.valset.push(Validator.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: HistoricalInfo): unknown { - const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - if (message.valset) { - obj.valset = message.valset.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.valset = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HistoricalInfo { - const message = { ...baseHistoricalInfo } as HistoricalInfo; - message.valset = []; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.valset !== undefined && object.valset !== null) { - for (const e of object.valset) { - message.valset.push(Validator.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCommissionRates: object = { - rate: "", - max_rate: "", - max_change_rate: "", -}; - -export const CommissionRates = { - encode(message: CommissionRates, writer: Writer = Writer.create()): Writer { - if (message.rate !== "") { - writer.uint32(10).string(message.rate); - } - if (message.max_rate !== "") { - writer.uint32(18).string(message.max_rate); - } - if (message.max_change_rate !== "") { - writer.uint32(26).string(message.max_change_rate); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CommissionRates { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommissionRates } as CommissionRates; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rate = reader.string(); - break; - case 2: - message.max_rate = reader.string(); - break; - case 3: - message.max_change_rate = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CommissionRates { - const message = { ...baseCommissionRates } as CommissionRates; - if (object.rate !== undefined && object.rate !== null) { - message.rate = String(object.rate); - } else { - message.rate = ""; - } - if (object.max_rate !== undefined && object.max_rate !== null) { - message.max_rate = String(object.max_rate); - } else { - message.max_rate = ""; - } - if ( - object.max_change_rate !== undefined && - object.max_change_rate !== null - ) { - message.max_change_rate = String(object.max_change_rate); - } else { - message.max_change_rate = ""; - } - return message; - }, - - toJSON(message: CommissionRates): unknown { - const obj: any = {}; - message.rate !== undefined && (obj.rate = message.rate); - message.max_rate !== undefined && (obj.max_rate = message.max_rate); - message.max_change_rate !== undefined && - (obj.max_change_rate = message.max_change_rate); - return obj; - }, - - fromPartial(object: DeepPartial): CommissionRates { - const message = { ...baseCommissionRates } as CommissionRates; - if (object.rate !== undefined && object.rate !== null) { - message.rate = object.rate; - } else { - message.rate = ""; - } - if (object.max_rate !== undefined && object.max_rate !== null) { - message.max_rate = object.max_rate; - } else { - message.max_rate = ""; - } - if ( - object.max_change_rate !== undefined && - object.max_change_rate !== null - ) { - message.max_change_rate = object.max_change_rate; - } else { - message.max_change_rate = ""; - } - return message; - }, -}; - -const baseCommission: object = {}; - -export const Commission = { - encode(message: Commission, writer: Writer = Writer.create()): Writer { - if (message.commission_rates !== undefined) { - CommissionRates.encode( - message.commission_rates, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.update_time !== undefined) { - Timestamp.encode( - toTimestamp(message.update_time), - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Commission { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommission } as Commission; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.commission_rates = CommissionRates.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.update_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Commission { - const message = { ...baseCommission } as Commission; - if ( - object.commission_rates !== undefined && - object.commission_rates !== null - ) { - message.commission_rates = CommissionRates.fromJSON( - object.commission_rates - ); - } else { - message.commission_rates = undefined; - } - if (object.update_time !== undefined && object.update_time !== null) { - message.update_time = fromJsonTimestamp(object.update_time); - } else { - message.update_time = undefined; - } - return message; - }, - - toJSON(message: Commission): unknown { - const obj: any = {}; - message.commission_rates !== undefined && - (obj.commission_rates = message.commission_rates - ? CommissionRates.toJSON(message.commission_rates) - : undefined); - message.update_time !== undefined && - (obj.update_time = - message.update_time !== undefined - ? message.update_time.toISOString() - : null); - return obj; - }, - - fromPartial(object: DeepPartial): Commission { - const message = { ...baseCommission } as Commission; - if ( - object.commission_rates !== undefined && - object.commission_rates !== null - ) { - message.commission_rates = CommissionRates.fromPartial( - object.commission_rates - ); - } else { - message.commission_rates = undefined; - } - if (object.update_time !== undefined && object.update_time !== null) { - message.update_time = object.update_time; - } else { - message.update_time = undefined; - } - return message; - }, -}; - -const baseDescription: object = { - moniker: "", - identity: "", - website: "", - security_contact: "", - details: "", -}; - -export const Description = { - encode(message: Description, writer: Writer = Writer.create()): Writer { - if (message.moniker !== "") { - writer.uint32(10).string(message.moniker); - } - if (message.identity !== "") { - writer.uint32(18).string(message.identity); - } - if (message.website !== "") { - writer.uint32(26).string(message.website); - } - if (message.security_contact !== "") { - writer.uint32(34).string(message.security_contact); - } - if (message.details !== "") { - writer.uint32(42).string(message.details); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Description { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescription } as Description; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.moniker = reader.string(); - break; - case 2: - message.identity = reader.string(); - break; - case 3: - message.website = reader.string(); - break; - case 4: - message.security_contact = reader.string(); - break; - case 5: - message.details = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Description { - const message = { ...baseDescription } as Description; - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = String(object.moniker); - } else { - message.moniker = ""; - } - if (object.identity !== undefined && object.identity !== null) { - message.identity = String(object.identity); - } else { - message.identity = ""; - } - if (object.website !== undefined && object.website !== null) { - message.website = String(object.website); - } else { - message.website = ""; - } - if ( - object.security_contact !== undefined && - object.security_contact !== null - ) { - message.security_contact = String(object.security_contact); - } else { - message.security_contact = ""; - } - if (object.details !== undefined && object.details !== null) { - message.details = String(object.details); - } else { - message.details = ""; - } - return message; - }, - - toJSON(message: Description): unknown { - const obj: any = {}; - message.moniker !== undefined && (obj.moniker = message.moniker); - message.identity !== undefined && (obj.identity = message.identity); - message.website !== undefined && (obj.website = message.website); - message.security_contact !== undefined && - (obj.security_contact = message.security_contact); - message.details !== undefined && (obj.details = message.details); - return obj; - }, - - fromPartial(object: DeepPartial): Description { - const message = { ...baseDescription } as Description; - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = object.moniker; - } else { - message.moniker = ""; - } - if (object.identity !== undefined && object.identity !== null) { - message.identity = object.identity; - } else { - message.identity = ""; - } - if (object.website !== undefined && object.website !== null) { - message.website = object.website; - } else { - message.website = ""; - } - if ( - object.security_contact !== undefined && - object.security_contact !== null - ) { - message.security_contact = object.security_contact; - } else { - message.security_contact = ""; - } - if (object.details !== undefined && object.details !== null) { - message.details = object.details; - } else { - message.details = ""; - } - return message; - }, -}; - -const baseValidator: object = { - operator_address: "", - jailed: false, - status: 0, - tokens: "", - delegator_shares: "", - unbonding_height: 0, - min_self_delegation: "", -}; - -export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { - if (message.operator_address !== "") { - writer.uint32(10).string(message.operator_address); - } - if (message.consensus_pubkey !== undefined) { - Any.encode(message.consensus_pubkey, writer.uint32(18).fork()).ldelim(); - } - if (message.jailed === true) { - writer.uint32(24).bool(message.jailed); - } - if (message.status !== 0) { - writer.uint32(32).int32(message.status); - } - if (message.tokens !== "") { - writer.uint32(42).string(message.tokens); - } - if (message.delegator_shares !== "") { - writer.uint32(50).string(message.delegator_shares); - } - if (message.description !== undefined) { - Description.encode( - message.description, - writer.uint32(58).fork() - ).ldelim(); - } - if (message.unbonding_height !== 0) { - writer.uint32(64).int64(message.unbonding_height); - } - if (message.unbonding_time !== undefined) { - Timestamp.encode( - toTimestamp(message.unbonding_time), - writer.uint32(74).fork() - ).ldelim(); - } - if (message.commission !== undefined) { - Commission.encode(message.commission, writer.uint32(82).fork()).ldelim(); - } - if (message.min_self_delegation !== "") { - writer.uint32(90).string(message.min_self_delegation); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.operator_address = reader.string(); - break; - case 2: - message.consensus_pubkey = Any.decode(reader, reader.uint32()); - break; - case 3: - message.jailed = reader.bool(); - break; - case 4: - message.status = reader.int32() as any; - break; - case 5: - message.tokens = reader.string(); - break; - case 6: - message.delegator_shares = reader.string(); - break; - case 7: - message.description = Description.decode(reader, reader.uint32()); - break; - case 8: - message.unbonding_height = longToNumber(reader.int64() as Long); - break; - case 9: - message.unbonding_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 10: - message.commission = Commission.decode(reader, reader.uint32()); - break; - case 11: - message.min_self_delegation = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if ( - object.operator_address !== undefined && - object.operator_address !== null - ) { - message.operator_address = String(object.operator_address); - } else { - message.operator_address = ""; - } - if ( - object.consensus_pubkey !== undefined && - object.consensus_pubkey !== null - ) { - message.consensus_pubkey = Any.fromJSON(object.consensus_pubkey); - } else { - message.consensus_pubkey = undefined; - } - if (object.jailed !== undefined && object.jailed !== null) { - message.jailed = Boolean(object.jailed); - } else { - message.jailed = false; - } - if (object.status !== undefined && object.status !== null) { - message.status = bondStatusFromJSON(object.status); - } else { - message.status = 0; - } - if (object.tokens !== undefined && object.tokens !== null) { - message.tokens = String(object.tokens); - } else { - message.tokens = ""; - } - if ( - object.delegator_shares !== undefined && - object.delegator_shares !== null - ) { - message.delegator_shares = String(object.delegator_shares); - } else { - message.delegator_shares = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromJSON(object.description); - } else { - message.description = undefined; - } - if ( - object.unbonding_height !== undefined && - object.unbonding_height !== null - ) { - message.unbonding_height = Number(object.unbonding_height); - } else { - message.unbonding_height = 0; - } - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbonding_time = fromJsonTimestamp(object.unbonding_time); - } else { - message.unbonding_time = undefined; - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = Commission.fromJSON(object.commission); - } else { - message.commission = undefined; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = String(object.min_self_delegation); - } else { - message.min_self_delegation = ""; - } - return message; - }, - - toJSON(message: Validator): unknown { - const obj: any = {}; - message.operator_address !== undefined && - (obj.operator_address = message.operator_address); - message.consensus_pubkey !== undefined && - (obj.consensus_pubkey = message.consensus_pubkey - ? Any.toJSON(message.consensus_pubkey) - : undefined); - message.jailed !== undefined && (obj.jailed = message.jailed); - message.status !== undefined && - (obj.status = bondStatusToJSON(message.status)); - message.tokens !== undefined && (obj.tokens = message.tokens); - message.delegator_shares !== undefined && - (obj.delegator_shares = message.delegator_shares); - message.description !== undefined && - (obj.description = message.description - ? Description.toJSON(message.description) - : undefined); - message.unbonding_height !== undefined && - (obj.unbonding_height = message.unbonding_height); - message.unbonding_time !== undefined && - (obj.unbonding_time = - message.unbonding_time !== undefined - ? message.unbonding_time.toISOString() - : null); - message.commission !== undefined && - (obj.commission = message.commission - ? Commission.toJSON(message.commission) - : undefined); - message.min_self_delegation !== undefined && - (obj.min_self_delegation = message.min_self_delegation); - return obj; - }, - - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if ( - object.operator_address !== undefined && - object.operator_address !== null - ) { - message.operator_address = object.operator_address; - } else { - message.operator_address = ""; - } - if ( - object.consensus_pubkey !== undefined && - object.consensus_pubkey !== null - ) { - message.consensus_pubkey = Any.fromPartial(object.consensus_pubkey); - } else { - message.consensus_pubkey = undefined; - } - if (object.jailed !== undefined && object.jailed !== null) { - message.jailed = object.jailed; - } else { - message.jailed = false; - } - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } else { - message.status = 0; - } - if (object.tokens !== undefined && object.tokens !== null) { - message.tokens = object.tokens; - } else { - message.tokens = ""; - } - if ( - object.delegator_shares !== undefined && - object.delegator_shares !== null - ) { - message.delegator_shares = object.delegator_shares; - } else { - message.delegator_shares = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromPartial(object.description); - } else { - message.description = undefined; - } - if ( - object.unbonding_height !== undefined && - object.unbonding_height !== null - ) { - message.unbonding_height = object.unbonding_height; - } else { - message.unbonding_height = 0; - } - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbonding_time = object.unbonding_time; - } else { - message.unbonding_time = undefined; - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = Commission.fromPartial(object.commission); - } else { - message.commission = undefined; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = object.min_self_delegation; - } else { - message.min_self_delegation = ""; - } - return message; - }, -}; - -const baseValAddresses: object = { addresses: "" }; - -export const ValAddresses = { - encode(message: ValAddresses, writer: Writer = Writer.create()): Writer { - for (const v of message.addresses) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValAddresses { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValAddresses } as ValAddresses; - message.addresses = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.addresses.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValAddresses { - const message = { ...baseValAddresses } as ValAddresses; - message.addresses = []; - if (object.addresses !== undefined && object.addresses !== null) { - for (const e of object.addresses) { - message.addresses.push(String(e)); - } - } - return message; - }, - - toJSON(message: ValAddresses): unknown { - const obj: any = {}; - if (message.addresses) { - obj.addresses = message.addresses.map((e) => e); - } else { - obj.addresses = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ValAddresses { - const message = { ...baseValAddresses } as ValAddresses; - message.addresses = []; - if (object.addresses !== undefined && object.addresses !== null) { - for (const e of object.addresses) { - message.addresses.push(e); - } - } - return message; - }, -}; - -const baseDVPair: object = { delegator_address: "", validator_address: "" }; - -export const DVPair = { - encode(message: DVPair, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DVPair { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDVPair } as DVPair; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DVPair { - const message = { ...baseDVPair } as DVPair; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; - }, - - toJSON(message: DVPair): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - return obj; - }, - - fromPartial(object: DeepPartial): DVPair { - const message = { ...baseDVPair } as DVPair; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - return message; - }, -}; - -const baseDVPairs: object = {}; - -export const DVPairs = { - encode(message: DVPairs, writer: Writer = Writer.create()): Writer { - for (const v of message.pairs) { - DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DVPairs { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDVPairs } as DVPairs; - message.pairs = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pairs.push(DVPair.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DVPairs { - const message = { ...baseDVPairs } as DVPairs; - message.pairs = []; - if (object.pairs !== undefined && object.pairs !== null) { - for (const e of object.pairs) { - message.pairs.push(DVPair.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: DVPairs): unknown { - const obj: any = {}; - if (message.pairs) { - obj.pairs = message.pairs.map((e) => (e ? DVPair.toJSON(e) : undefined)); - } else { - obj.pairs = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DVPairs { - const message = { ...baseDVPairs } as DVPairs; - message.pairs = []; - if (object.pairs !== undefined && object.pairs !== null) { - for (const e of object.pairs) { - message.pairs.push(DVPair.fromPartial(e)); - } - } - return message; - }, -}; - -const baseDVVTriplet: object = { - delegator_address: "", - validator_src_address: "", - validator_dst_address: "", -}; - -export const DVVTriplet = { - encode(message: DVVTriplet, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_src_address !== "") { - writer.uint32(18).string(message.validator_src_address); - } - if (message.validator_dst_address !== "") { - writer.uint32(26).string(message.validator_dst_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DVVTriplet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDVVTriplet } as DVVTriplet; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_src_address = reader.string(); - break; - case 3: - message.validator_dst_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DVVTriplet { - const message = { ...baseDVVTriplet } as DVVTriplet; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = String(object.validator_src_address); - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = String(object.validator_dst_address); - } else { - message.validator_dst_address = ""; - } - return message; - }, - - toJSON(message: DVVTriplet): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_src_address !== undefined && - (obj.validator_src_address = message.validator_src_address); - message.validator_dst_address !== undefined && - (obj.validator_dst_address = message.validator_dst_address); - return obj; - }, - - fromPartial(object: DeepPartial): DVVTriplet { - const message = { ...baseDVVTriplet } as DVVTriplet; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = object.validator_src_address; - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = object.validator_dst_address; - } else { - message.validator_dst_address = ""; - } - return message; - }, -}; - -const baseDVVTriplets: object = {}; - -export const DVVTriplets = { - encode(message: DVVTriplets, writer: Writer = Writer.create()): Writer { - for (const v of message.triplets) { - DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DVVTriplets { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDVVTriplets } as DVVTriplets; - message.triplets = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.triplets.push(DVVTriplet.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DVVTriplets { - const message = { ...baseDVVTriplets } as DVVTriplets; - message.triplets = []; - if (object.triplets !== undefined && object.triplets !== null) { - for (const e of object.triplets) { - message.triplets.push(DVVTriplet.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: DVVTriplets): unknown { - const obj: any = {}; - if (message.triplets) { - obj.triplets = message.triplets.map((e) => - e ? DVVTriplet.toJSON(e) : undefined - ); - } else { - obj.triplets = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DVVTriplets { - const message = { ...baseDVVTriplets } as DVVTriplets; - message.triplets = []; - if (object.triplets !== undefined && object.triplets !== null) { - for (const e of object.triplets) { - message.triplets.push(DVVTriplet.fromPartial(e)); - } - } - return message; - }, -}; - -const baseDelegation: object = { - delegator_address: "", - validator_address: "", - shares: "", -}; - -export const Delegation = { - encode(message: Delegation, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); - } - if (message.shares !== "") { - writer.uint32(26).string(message.shares); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Delegation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelegation } as Delegation; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_address = reader.string(); - break; - case 3: - message.shares = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Delegation { - const message = { ...baseDelegation } as Delegation; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.shares !== undefined && object.shares !== null) { - message.shares = String(object.shares); - } else { - message.shares = ""; - } - return message; - }, - - toJSON(message: Delegation): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.shares !== undefined && (obj.shares = message.shares); - return obj; - }, - - fromPartial(object: DeepPartial): Delegation { - const message = { ...baseDelegation } as Delegation; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.shares !== undefined && object.shares !== null) { - message.shares = object.shares; - } else { - message.shares = ""; - } - return message; - }, -}; - -const baseUnbondingDelegation: object = { - delegator_address: "", - validator_address: "", -}; - -export const UnbondingDelegation = { - encode( - message: UnbondingDelegation, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); - } - for (const v of message.entries) { - UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UnbondingDelegation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUnbondingDelegation } as UnbondingDelegation; - message.entries = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_address = reader.string(); - break; - case 3: - message.entries.push( - UnbondingDelegationEntry.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UnbondingDelegation { - const message = { ...baseUnbondingDelegation } as UnbondingDelegation; - message.entries = []; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(UnbondingDelegationEntry.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: UnbondingDelegation): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - if (message.entries) { - obj.entries = message.entries.map((e) => - e ? UnbondingDelegationEntry.toJSON(e) : undefined - ); - } else { - obj.entries = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): UnbondingDelegation { - const message = { ...baseUnbondingDelegation } as UnbondingDelegation; - message.entries = []; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(UnbondingDelegationEntry.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUnbondingDelegationEntry: object = { - creation_height: 0, - initial_balance: "", - balance: "", -}; - -export const UnbondingDelegationEntry = { - encode( - message: UnbondingDelegationEntry, - writer: Writer = Writer.create() - ): Writer { - if (message.creation_height !== 0) { - writer.uint32(8).int64(message.creation_height); - } - if (message.completion_time !== undefined) { - Timestamp.encode( - toTimestamp(message.completion_time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.initial_balance !== "") { - writer.uint32(26).string(message.initial_balance); - } - if (message.balance !== "") { - writer.uint32(34).string(message.balance); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UnbondingDelegationEntry { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUnbondingDelegationEntry, - } as UnbondingDelegationEntry; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creation_height = longToNumber(reader.int64() as Long); - break; - case 2: - message.completion_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 3: - message.initial_balance = reader.string(); - break; - case 4: - message.balance = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UnbondingDelegationEntry { - const message = { - ...baseUnbondingDelegationEntry, - } as UnbondingDelegationEntry; - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creation_height = Number(object.creation_height); - } else { - message.creation_height = 0; - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = fromJsonTimestamp(object.completion_time); - } else { - message.completion_time = undefined; - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initial_balance = String(object.initial_balance); - } else { - message.initial_balance = ""; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = String(object.balance); - } else { - message.balance = ""; - } - return message; - }, - - toJSON(message: UnbondingDelegationEntry): unknown { - const obj: any = {}; - message.creation_height !== undefined && - (obj.creation_height = message.creation_height); - message.completion_time !== undefined && - (obj.completion_time = - message.completion_time !== undefined - ? message.completion_time.toISOString() - : null); - message.initial_balance !== undefined && - (obj.initial_balance = message.initial_balance); - message.balance !== undefined && (obj.balance = message.balance); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UnbondingDelegationEntry { - const message = { - ...baseUnbondingDelegationEntry, - } as UnbondingDelegationEntry; - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creation_height = object.creation_height; - } else { - message.creation_height = 0; - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = object.completion_time; - } else { - message.completion_time = undefined; - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initial_balance = object.initial_balance; - } else { - message.initial_balance = ""; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = object.balance; - } else { - message.balance = ""; - } - return message; - }, -}; - -const baseRedelegationEntry: object = { - creation_height: 0, - initial_balance: "", - shares_dst: "", -}; - -export const RedelegationEntry = { - encode(message: RedelegationEntry, writer: Writer = Writer.create()): Writer { - if (message.creation_height !== 0) { - writer.uint32(8).int64(message.creation_height); - } - if (message.completion_time !== undefined) { - Timestamp.encode( - toTimestamp(message.completion_time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.initial_balance !== "") { - writer.uint32(26).string(message.initial_balance); - } - if (message.shares_dst !== "") { - writer.uint32(34).string(message.shares_dst); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RedelegationEntry { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRedelegationEntry } as RedelegationEntry; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creation_height = longToNumber(reader.int64() as Long); - break; - case 2: - message.completion_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 3: - message.initial_balance = reader.string(); - break; - case 4: - message.shares_dst = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RedelegationEntry { - const message = { ...baseRedelegationEntry } as RedelegationEntry; - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creation_height = Number(object.creation_height); - } else { - message.creation_height = 0; - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = fromJsonTimestamp(object.completion_time); - } else { - message.completion_time = undefined; - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initial_balance = String(object.initial_balance); - } else { - message.initial_balance = ""; - } - if (object.shares_dst !== undefined && object.shares_dst !== null) { - message.shares_dst = String(object.shares_dst); - } else { - message.shares_dst = ""; - } - return message; - }, - - toJSON(message: RedelegationEntry): unknown { - const obj: any = {}; - message.creation_height !== undefined && - (obj.creation_height = message.creation_height); - message.completion_time !== undefined && - (obj.completion_time = - message.completion_time !== undefined - ? message.completion_time.toISOString() - : null); - message.initial_balance !== undefined && - (obj.initial_balance = message.initial_balance); - message.shares_dst !== undefined && (obj.shares_dst = message.shares_dst); - return obj; - }, - - fromPartial(object: DeepPartial): RedelegationEntry { - const message = { ...baseRedelegationEntry } as RedelegationEntry; - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creation_height = object.creation_height; - } else { - message.creation_height = 0; - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = object.completion_time; - } else { - message.completion_time = undefined; - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initial_balance = object.initial_balance; - } else { - message.initial_balance = ""; - } - if (object.shares_dst !== undefined && object.shares_dst !== null) { - message.shares_dst = object.shares_dst; - } else { - message.shares_dst = ""; - } - return message; - }, -}; - -const baseRedelegation: object = { - delegator_address: "", - validator_src_address: "", - validator_dst_address: "", -}; - -export const Redelegation = { - encode(message: Redelegation, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_src_address !== "") { - writer.uint32(18).string(message.validator_src_address); - } - if (message.validator_dst_address !== "") { - writer.uint32(26).string(message.validator_dst_address); - } - for (const v of message.entries) { - RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Redelegation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRedelegation } as Redelegation; - message.entries = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_src_address = reader.string(); - break; - case 3: - message.validator_dst_address = reader.string(); - break; - case 4: - message.entries.push( - RedelegationEntry.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Redelegation { - const message = { ...baseRedelegation } as Redelegation; - message.entries = []; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = String(object.validator_src_address); - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = String(object.validator_dst_address); - } else { - message.validator_dst_address = ""; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(RedelegationEntry.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Redelegation): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_src_address !== undefined && - (obj.validator_src_address = message.validator_src_address); - message.validator_dst_address !== undefined && - (obj.validator_dst_address = message.validator_dst_address); - if (message.entries) { - obj.entries = message.entries.map((e) => - e ? RedelegationEntry.toJSON(e) : undefined - ); - } else { - obj.entries = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Redelegation { - const message = { ...baseRedelegation } as Redelegation; - message.entries = []; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = object.validator_src_address; - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = object.validator_dst_address; - } else { - message.validator_dst_address = ""; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(RedelegationEntry.fromPartial(e)); - } - } - return message; - }, -}; - -const baseParams: object = { - max_validators: 0, - max_entries: 0, - historical_entries: 0, - bond_denom: "", -}; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.unbonding_time !== undefined) { - Duration.encode( - message.unbonding_time, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.max_validators !== 0) { - writer.uint32(16).uint32(message.max_validators); - } - if (message.max_entries !== 0) { - writer.uint32(24).uint32(message.max_entries); - } - if (message.historical_entries !== 0) { - writer.uint32(32).uint32(message.historical_entries); - } - if (message.bond_denom !== "") { - writer.uint32(42).string(message.bond_denom); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.unbonding_time = Duration.decode(reader, reader.uint32()); - break; - case 2: - message.max_validators = reader.uint32(); - break; - case 3: - message.max_entries = reader.uint32(); - break; - case 4: - message.historical_entries = reader.uint32(); - break; - case 5: - message.bond_denom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbonding_time = Duration.fromJSON(object.unbonding_time); - } else { - message.unbonding_time = undefined; - } - if (object.max_validators !== undefined && object.max_validators !== null) { - message.max_validators = Number(object.max_validators); - } else { - message.max_validators = 0; - } - if (object.max_entries !== undefined && object.max_entries !== null) { - message.max_entries = Number(object.max_entries); - } else { - message.max_entries = 0; - } - if ( - object.historical_entries !== undefined && - object.historical_entries !== null - ) { - message.historical_entries = Number(object.historical_entries); - } else { - message.historical_entries = 0; - } - if (object.bond_denom !== undefined && object.bond_denom !== null) { - message.bond_denom = String(object.bond_denom); - } else { - message.bond_denom = ""; - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.unbonding_time !== undefined && - (obj.unbonding_time = message.unbonding_time - ? Duration.toJSON(message.unbonding_time) - : undefined); - message.max_validators !== undefined && - (obj.max_validators = message.max_validators); - message.max_entries !== undefined && - (obj.max_entries = message.max_entries); - message.historical_entries !== undefined && - (obj.historical_entries = message.historical_entries); - message.bond_denom !== undefined && (obj.bond_denom = message.bond_denom); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbonding_time = Duration.fromPartial(object.unbonding_time); - } else { - message.unbonding_time = undefined; - } - if (object.max_validators !== undefined && object.max_validators !== null) { - message.max_validators = object.max_validators; - } else { - message.max_validators = 0; - } - if (object.max_entries !== undefined && object.max_entries !== null) { - message.max_entries = object.max_entries; - } else { - message.max_entries = 0; - } - if ( - object.historical_entries !== undefined && - object.historical_entries !== null - ) { - message.historical_entries = object.historical_entries; - } else { - message.historical_entries = 0; - } - if (object.bond_denom !== undefined && object.bond_denom !== null) { - message.bond_denom = object.bond_denom; - } else { - message.bond_denom = ""; - } - return message; - }, -}; - -const baseDelegationResponse: object = {}; - -export const DelegationResponse = { - encode( - message: DelegationResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.delegation !== undefined) { - Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); - } - if (message.balance !== undefined) { - Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DelegationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelegationResponse } as DelegationResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegation = Delegation.decode(reader, reader.uint32()); - break; - case 2: - message.balance = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DelegationResponse { - const message = { ...baseDelegationResponse } as DelegationResponse; - if (object.delegation !== undefined && object.delegation !== null) { - message.delegation = Delegation.fromJSON(object.delegation); - } else { - message.delegation = undefined; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromJSON(object.balance); - } else { - message.balance = undefined; - } - return message; - }, - - toJSON(message: DelegationResponse): unknown { - const obj: any = {}; - message.delegation !== undefined && - (obj.delegation = message.delegation - ? Delegation.toJSON(message.delegation) - : undefined); - message.balance !== undefined && - (obj.balance = message.balance - ? Coin.toJSON(message.balance) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): DelegationResponse { - const message = { ...baseDelegationResponse } as DelegationResponse; - if (object.delegation !== undefined && object.delegation !== null) { - message.delegation = Delegation.fromPartial(object.delegation); - } else { - message.delegation = undefined; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromPartial(object.balance); - } else { - message.balance = undefined; - } - return message; - }, -}; - -const baseRedelegationEntryResponse: object = { balance: "" }; - -export const RedelegationEntryResponse = { - encode( - message: RedelegationEntryResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.redelegation_entry !== undefined) { - RedelegationEntry.encode( - message.redelegation_entry, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.balance !== "") { - writer.uint32(34).string(message.balance); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): RedelegationEntryResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseRedelegationEntryResponse, - } as RedelegationEntryResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.redelegation_entry = RedelegationEntry.decode( - reader, - reader.uint32() - ); - break; - case 4: - message.balance = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RedelegationEntryResponse { - const message = { - ...baseRedelegationEntryResponse, - } as RedelegationEntryResponse; - if ( - object.redelegation_entry !== undefined && - object.redelegation_entry !== null - ) { - message.redelegation_entry = RedelegationEntry.fromJSON( - object.redelegation_entry - ); - } else { - message.redelegation_entry = undefined; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = String(object.balance); - } else { - message.balance = ""; - } - return message; - }, - - toJSON(message: RedelegationEntryResponse): unknown { - const obj: any = {}; - message.redelegation_entry !== undefined && - (obj.redelegation_entry = message.redelegation_entry - ? RedelegationEntry.toJSON(message.redelegation_entry) - : undefined); - message.balance !== undefined && (obj.balance = message.balance); - return obj; - }, - - fromPartial( - object: DeepPartial - ): RedelegationEntryResponse { - const message = { - ...baseRedelegationEntryResponse, - } as RedelegationEntryResponse; - if ( - object.redelegation_entry !== undefined && - object.redelegation_entry !== null - ) { - message.redelegation_entry = RedelegationEntry.fromPartial( - object.redelegation_entry - ); - } else { - message.redelegation_entry = undefined; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = object.balance; - } else { - message.balance = ""; - } - return message; - }, -}; - -const baseRedelegationResponse: object = {}; - -export const RedelegationResponse = { - encode( - message: RedelegationResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.redelegation !== undefined) { - Redelegation.encode( - message.redelegation, - writer.uint32(10).fork() - ).ldelim(); - } - for (const v of message.entries) { - RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RedelegationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRedelegationResponse } as RedelegationResponse; - message.entries = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.redelegation = Redelegation.decode(reader, reader.uint32()); - break; - case 2: - message.entries.push( - RedelegationEntryResponse.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RedelegationResponse { - const message = { ...baseRedelegationResponse } as RedelegationResponse; - message.entries = []; - if (object.redelegation !== undefined && object.redelegation !== null) { - message.redelegation = Redelegation.fromJSON(object.redelegation); - } else { - message.redelegation = undefined; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(RedelegationEntryResponse.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: RedelegationResponse): unknown { - const obj: any = {}; - message.redelegation !== undefined && - (obj.redelegation = message.redelegation - ? Redelegation.toJSON(message.redelegation) - : undefined); - if (message.entries) { - obj.entries = message.entries.map((e) => - e ? RedelegationEntryResponse.toJSON(e) : undefined - ); - } else { - obj.entries = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): RedelegationResponse { - const message = { ...baseRedelegationResponse } as RedelegationResponse; - message.entries = []; - if (object.redelegation !== undefined && object.redelegation !== null) { - message.redelegation = Redelegation.fromPartial(object.redelegation); - } else { - message.redelegation = undefined; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(RedelegationEntryResponse.fromPartial(e)); - } - } - return message; - }, -}; - -const basePool: object = { not_bonded_tokens: "", bonded_tokens: "" }; - -export const Pool = { - encode(message: Pool, writer: Writer = Writer.create()): Writer { - if (message.not_bonded_tokens !== "") { - writer.uint32(10).string(message.not_bonded_tokens); - } - if (message.bonded_tokens !== "") { - writer.uint32(18).string(message.bonded_tokens); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Pool { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePool } as Pool; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.not_bonded_tokens = reader.string(); - break; - case 2: - message.bonded_tokens = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Pool { - const message = { ...basePool } as Pool; - if ( - object.not_bonded_tokens !== undefined && - object.not_bonded_tokens !== null - ) { - message.not_bonded_tokens = String(object.not_bonded_tokens); - } else { - message.not_bonded_tokens = ""; - } - if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { - message.bonded_tokens = String(object.bonded_tokens); - } else { - message.bonded_tokens = ""; - } - return message; - }, - - toJSON(message: Pool): unknown { - const obj: any = {}; - message.not_bonded_tokens !== undefined && - (obj.not_bonded_tokens = message.not_bonded_tokens); - message.bonded_tokens !== undefined && - (obj.bonded_tokens = message.bonded_tokens); - return obj; - }, - - fromPartial(object: DeepPartial): Pool { - const message = { ...basePool } as Pool; - if ( - object.not_bonded_tokens !== undefined && - object.not_bonded_tokens !== null - ) { - message.not_bonded_tokens = object.not_bonded_tokens; - } else { - message.not_bonded_tokens = ""; - } - if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { - message.bonded_tokens = object.bonded_tokens; - } else { - message.bonded_tokens = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/tx.ts deleted file mode 100644 index 3807dbc0..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos/staking/v1beta1/tx.ts +++ /dev/null @@ -1,1208 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { - Description, - CommissionRates, -} from "../../../cosmos/staking/v1beta1/staking"; -import { Any } from "../../../google/protobuf/any"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmos.staking.v1beta1"; - -/** MsgCreateValidator defines a SDK message for creating a new validator. */ -export interface MsgCreateValidator { - description: Description | undefined; - commission: CommissionRates | undefined; - min_self_delegation: string; - delegator_address: string; - validator_address: string; - pubkey: Any | undefined; - value: Coin | undefined; -} - -/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ -export interface MsgCreateValidatorResponse {} - -/** MsgEditValidator defines a SDK message for editing an existing validator. */ -export interface MsgEditValidator { - description: Description | undefined; - validator_address: string; - /** - * We pass a reference to the new commission rate and min self delegation as - * it's not mandatory to update. If not updated, the deserialized rate will be - * zero with no way to distinguish if an update was intended. - * REF: #2373 - */ - commission_rate: string; - min_self_delegation: string; -} - -/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ -export interface MsgEditValidatorResponse {} - -/** - * MsgDelegate defines a SDK message for performing a delegation of coins - * from a delegator to a validator. - */ -export interface MsgDelegate { - delegator_address: string; - validator_address: string; - amount: Coin | undefined; -} - -/** MsgDelegateResponse defines the Msg/Delegate response type. */ -export interface MsgDelegateResponse {} - -/** - * MsgBeginRedelegate defines a SDK message for performing a redelegation - * of coins from a delegator and source validator to a destination validator. - */ -export interface MsgBeginRedelegate { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; - amount: Coin | undefined; -} - -/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ -export interface MsgBeginRedelegateResponse { - completion_time: Date | undefined; -} - -/** - * MsgUndelegate defines a SDK message for performing an undelegation from a - * delegate and a validator. - */ -export interface MsgUndelegate { - delegator_address: string; - validator_address: string; - amount: Coin | undefined; -} - -/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ -export interface MsgUndelegateResponse { - completion_time: Date | undefined; -} - -const baseMsgCreateValidator: object = { - min_self_delegation: "", - delegator_address: "", - validator_address: "", -}; - -export const MsgCreateValidator = { - encode( - message: MsgCreateValidator, - writer: Writer = Writer.create() - ): Writer { - if (message.description !== undefined) { - Description.encode( - message.description, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.commission !== undefined) { - CommissionRates.encode( - message.commission, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.min_self_delegation !== "") { - writer.uint32(26).string(message.min_self_delegation); - } - if (message.delegator_address !== "") { - writer.uint32(34).string(message.delegator_address); - } - if (message.validator_address !== "") { - writer.uint32(42).string(message.validator_address); - } - if (message.pubkey !== undefined) { - Any.encode(message.pubkey, writer.uint32(50).fork()).ldelim(); - } - if (message.value !== undefined) { - Coin.encode(message.value, writer.uint32(58).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgCreateValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgCreateValidator } as MsgCreateValidator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.description = Description.decode(reader, reader.uint32()); - break; - case 2: - message.commission = CommissionRates.decode(reader, reader.uint32()); - break; - case 3: - message.min_self_delegation = reader.string(); - break; - case 4: - message.delegator_address = reader.string(); - break; - case 5: - message.validator_address = reader.string(); - break; - case 6: - message.pubkey = Any.decode(reader, reader.uint32()); - break; - case 7: - message.value = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateValidator { - const message = { ...baseMsgCreateValidator } as MsgCreateValidator; - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromJSON(object.description); - } else { - message.description = undefined; - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = CommissionRates.fromJSON(object.commission); - } else { - message.commission = undefined; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = String(object.min_self_delegation); - } else { - message.min_self_delegation = ""; - } - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.pubkey !== undefined && object.pubkey !== null) { - message.pubkey = Any.fromJSON(object.pubkey); - } else { - message.pubkey = undefined; - } - if (object.value !== undefined && object.value !== null) { - message.value = Coin.fromJSON(object.value); - } else { - message.value = undefined; - } - return message; - }, - - toJSON(message: MsgCreateValidator): unknown { - const obj: any = {}; - message.description !== undefined && - (obj.description = message.description - ? Description.toJSON(message.description) - : undefined); - message.commission !== undefined && - (obj.commission = message.commission - ? CommissionRates.toJSON(message.commission) - : undefined); - message.min_self_delegation !== undefined && - (obj.min_self_delegation = message.min_self_delegation); - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.pubkey !== undefined && - (obj.pubkey = message.pubkey ? Any.toJSON(message.pubkey) : undefined); - message.value !== undefined && - (obj.value = message.value ? Coin.toJSON(message.value) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): MsgCreateValidator { - const message = { ...baseMsgCreateValidator } as MsgCreateValidator; - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromPartial(object.description); - } else { - message.description = undefined; - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = CommissionRates.fromPartial(object.commission); - } else { - message.commission = undefined; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = object.min_self_delegation; - } else { - message.min_self_delegation = ""; - } - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.pubkey !== undefined && object.pubkey !== null) { - message.pubkey = Any.fromPartial(object.pubkey); - } else { - message.pubkey = undefined; - } - if (object.value !== undefined && object.value !== null) { - message.value = Coin.fromPartial(object.value); - } else { - message.value = undefined; - } - return message; - }, -}; - -const baseMsgCreateValidatorResponse: object = {}; - -export const MsgCreateValidatorResponse = { - encode( - _: MsgCreateValidatorResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgCreateValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgCreateValidatorResponse, - } as MsgCreateValidatorResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateValidatorResponse { - const message = { - ...baseMsgCreateValidatorResponse, - } as MsgCreateValidatorResponse; - return message; - }, - - toJSON(_: MsgCreateValidatorResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgCreateValidatorResponse { - const message = { - ...baseMsgCreateValidatorResponse, - } as MsgCreateValidatorResponse; - return message; - }, -}; - -const baseMsgEditValidator: object = { - validator_address: "", - commission_rate: "", - min_self_delegation: "", -}; - -export const MsgEditValidator = { - encode(message: MsgEditValidator, writer: Writer = Writer.create()): Writer { - if (message.description !== undefined) { - Description.encode( - message.description, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); - } - if (message.commission_rate !== "") { - writer.uint32(26).string(message.commission_rate); - } - if (message.min_self_delegation !== "") { - writer.uint32(34).string(message.min_self_delegation); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgEditValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgEditValidator } as MsgEditValidator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.description = Description.decode(reader, reader.uint32()); - break; - case 2: - message.validator_address = reader.string(); - break; - case 3: - message.commission_rate = reader.string(); - break; - case 4: - message.min_self_delegation = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgEditValidator { - const message = { ...baseMsgEditValidator } as MsgEditValidator; - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromJSON(object.description); - } else { - message.description = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if ( - object.commission_rate !== undefined && - object.commission_rate !== null - ) { - message.commission_rate = String(object.commission_rate); - } else { - message.commission_rate = ""; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = String(object.min_self_delegation); - } else { - message.min_self_delegation = ""; - } - return message; - }, - - toJSON(message: MsgEditValidator): unknown { - const obj: any = {}; - message.description !== undefined && - (obj.description = message.description - ? Description.toJSON(message.description) - : undefined); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.commission_rate !== undefined && - (obj.commission_rate = message.commission_rate); - message.min_self_delegation !== undefined && - (obj.min_self_delegation = message.min_self_delegation); - return obj; - }, - - fromPartial(object: DeepPartial): MsgEditValidator { - const message = { ...baseMsgEditValidator } as MsgEditValidator; - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromPartial(object.description); - } else { - message.description = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if ( - object.commission_rate !== undefined && - object.commission_rate !== null - ) { - message.commission_rate = object.commission_rate; - } else { - message.commission_rate = ""; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = object.min_self_delegation; - } else { - message.min_self_delegation = ""; - } - return message; - }, -}; - -const baseMsgEditValidatorResponse: object = {}; - -export const MsgEditValidatorResponse = { - encode( - _: MsgEditValidatorResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgEditValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgEditValidatorResponse, - } as MsgEditValidatorResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgEditValidatorResponse { - const message = { - ...baseMsgEditValidatorResponse, - } as MsgEditValidatorResponse; - return message; - }, - - toJSON(_: MsgEditValidatorResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgEditValidatorResponse { - const message = { - ...baseMsgEditValidatorResponse, - } as MsgEditValidatorResponse; - return message; - }, -}; - -const baseMsgDelegate: object = { - delegator_address: "", - validator_address: "", -}; - -export const MsgDelegate = { - encode(message: MsgDelegate, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); - } - if (message.amount !== undefined) { - Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgDelegate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgDelegate } as MsgDelegate; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_address = reader.string(); - break; - case 3: - message.amount = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDelegate { - const message = { ...baseMsgDelegate } as MsgDelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - return message; - }, - - toJSON(message: MsgDelegate): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): MsgDelegate { - const message = { ...baseMsgDelegate } as MsgDelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; - } - return message; - }, -}; - -const baseMsgDelegateResponse: object = {}; - -export const MsgDelegateResponse = { - encode(_: MsgDelegateResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgDelegateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgDelegateResponse { - const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; - return message; - }, - - toJSON(_: MsgDelegateResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgDelegateResponse { - const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; - return message; - }, -}; - -const baseMsgBeginRedelegate: object = { - delegator_address: "", - validator_src_address: "", - validator_dst_address: "", -}; - -export const MsgBeginRedelegate = { - encode( - message: MsgBeginRedelegate, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_src_address !== "") { - writer.uint32(18).string(message.validator_src_address); - } - if (message.validator_dst_address !== "") { - writer.uint32(26).string(message.validator_dst_address); - } - if (message.amount !== undefined) { - Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgBeginRedelegate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_src_address = reader.string(); - break; - case 3: - message.validator_dst_address = reader.string(); - break; - case 4: - message.amount = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgBeginRedelegate { - const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = String(object.validator_src_address); - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = String(object.validator_dst_address); - } else { - message.validator_dst_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - return message; - }, - - toJSON(message: MsgBeginRedelegate): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_src_address !== undefined && - (obj.validator_src_address = message.validator_src_address); - message.validator_dst_address !== undefined && - (obj.validator_dst_address = message.validator_dst_address); - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): MsgBeginRedelegate { - const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = object.validator_src_address; - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = object.validator_dst_address; - } else { - message.validator_dst_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; - } - return message; - }, -}; - -const baseMsgBeginRedelegateResponse: object = {}; - -export const MsgBeginRedelegateResponse = { - encode( - message: MsgBeginRedelegateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.completion_time !== undefined) { - Timestamp.encode( - toTimestamp(message.completion_time), - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgBeginRedelegateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgBeginRedelegateResponse, - } as MsgBeginRedelegateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.completion_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgBeginRedelegateResponse { - const message = { - ...baseMsgBeginRedelegateResponse, - } as MsgBeginRedelegateResponse; - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = fromJsonTimestamp(object.completion_time); - } else { - message.completion_time = undefined; - } - return message; - }, - - toJSON(message: MsgBeginRedelegateResponse): unknown { - const obj: any = {}; - message.completion_time !== undefined && - (obj.completion_time = - message.completion_time !== undefined - ? message.completion_time.toISOString() - : null); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgBeginRedelegateResponse { - const message = { - ...baseMsgBeginRedelegateResponse, - } as MsgBeginRedelegateResponse; - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = object.completion_time; - } else { - message.completion_time = undefined; - } - return message; - }, -}; - -const baseMsgUndelegate: object = { - delegator_address: "", - validator_address: "", -}; - -export const MsgUndelegate = { - encode(message: MsgUndelegate, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); - } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); - } - if (message.amount !== undefined) { - Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgUndelegate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUndelegate } as MsgUndelegate; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegator_address = reader.string(); - break; - case 2: - message.validator_address = reader.string(); - break; - case 3: - message.amount = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUndelegate { - const message = { ...baseMsgUndelegate } as MsgUndelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - return message; - }, - - toJSON(message: MsgUndelegate): unknown { - const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): MsgUndelegate { - const message = { ...baseMsgUndelegate } as MsgUndelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; - } - return message; - }, -}; - -const baseMsgUndelegateResponse: object = {}; - -export const MsgUndelegateResponse = { - encode( - message: MsgUndelegateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.completion_time !== undefined) { - Timestamp.encode( - toTimestamp(message.completion_time), - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgUndelegateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.completion_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUndelegateResponse { - const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = fromJsonTimestamp(object.completion_time); - } else { - message.completion_time = undefined; - } - return message; - }, - - toJSON(message: MsgUndelegateResponse): unknown { - const obj: any = {}; - message.completion_time !== undefined && - (obj.completion_time = - message.completion_time !== undefined - ? message.completion_time.toISOString() - : null); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgUndelegateResponse { - const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = object.completion_time; - } else { - message.completion_time = undefined; - } - return message; - }, -}; - -/** Msg defines the staking Msg service. */ -export interface Msg { - /** CreateValidator defines a method for creating a new validator. */ - CreateValidator( - request: MsgCreateValidator - ): Promise; - /** EditValidator defines a method for editing an existing validator. */ - EditValidator(request: MsgEditValidator): Promise; - /** - * Delegate defines a method for performing a delegation of coins - * from a delegator to a validator. - */ - Delegate(request: MsgDelegate): Promise; - /** - * BeginRedelegate defines a method for performing a redelegation - * of coins from a delegator and source validator to a destination validator. - */ - BeginRedelegate( - request: MsgBeginRedelegate - ): Promise; - /** - * Undelegate defines a method for performing an undelegation from a - * delegate and a validator. - */ - Undelegate(request: MsgUndelegate): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - CreateValidator( - request: MsgCreateValidator - ): Promise { - const data = MsgCreateValidator.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "CreateValidator", - data - ); - return promise.then((data) => - MsgCreateValidatorResponse.decode(new Reader(data)) - ); - } - - EditValidator(request: MsgEditValidator): Promise { - const data = MsgEditValidator.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "EditValidator", - data - ); - return promise.then((data) => - MsgEditValidatorResponse.decode(new Reader(data)) - ); - } - - Delegate(request: MsgDelegate): Promise { - const data = MsgDelegate.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "Delegate", - data - ); - return promise.then((data) => MsgDelegateResponse.decode(new Reader(data))); - } - - BeginRedelegate( - request: MsgBeginRedelegate - ): Promise { - const data = MsgBeginRedelegate.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "BeginRedelegate", - data - ); - return promise.then((data) => - MsgBeginRedelegateResponse.decode(new Reader(data)) - ); - } - - Undelegate(request: MsgUndelegate): Promise { - const data = MsgUndelegate.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "Undelegate", - data - ); - return promise.then((data) => - MsgUndelegateResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos_proto/cosmos.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos_proto/cosmos.ts deleted file mode 100644 index 9ec67a12..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/cosmos_proto/cosmos.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "cosmos_proto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/duration.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/duration.ts deleted file mode 100644 index fffd5b14..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/duration.ts +++ /dev/null @@ -1,188 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - */ -export interface Duration { - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ - seconds: number; - /** - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - */ - nanos: number; -} - -const baseDuration: object = { seconds: 0, nanos: 0 }; - -export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDuration } as Duration; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Duration): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/crypto/keys.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/crypto/keys.ts deleted file mode 100644 index 450db2a1..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/crypto/keys.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.crypto"; - -/** PublicKey defines the keys available for use with Tendermint Validators */ -export interface PublicKey { - ed25519: Uint8Array | undefined; - secp256k1: Uint8Array | undefined; -} - -const basePublicKey: object = {}; - -export const PublicKey = { - encode(message: PublicKey, writer: Writer = Writer.create()): Writer { - if (message.ed25519 !== undefined) { - writer.uint32(10).bytes(message.ed25519); - } - if (message.secp256k1 !== undefined) { - writer.uint32(18).bytes(message.secp256k1); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PublicKey { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePublicKey } as PublicKey; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ed25519 = reader.bytes(); - break; - case 2: - message.secp256k1 = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = bytesFromBase64(object.ed25519); - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = bytesFromBase64(object.secp256k1); - } - return message; - }, - - toJSON(message: PublicKey): unknown { - const obj: any = {}; - message.ed25519 !== undefined && - (obj.ed25519 = - message.ed25519 !== undefined - ? base64FromBytes(message.ed25519) - : undefined); - message.secp256k1 !== undefined && - (obj.secp256k1 = - message.secp256k1 !== undefined - ? base64FromBytes(message.secp256k1) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = object.ed25519; - } else { - message.ed25519 = undefined; - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = object.secp256k1; - } else { - message.secp256k1 = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/crypto/proof.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/crypto/proof.ts deleted file mode 100644 index db058694..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/crypto/proof.ts +++ /dev/null @@ -1,529 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.crypto"; - -export interface Proof { - total: number; - index: number; - leaf_hash: Uint8Array; - aunts: Uint8Array[]; -} - -export interface ValueOp { - /** Encoded in ProofOp.Key. */ - key: Uint8Array; - /** To encode in ProofOp.Data */ - proof: Proof | undefined; -} - -export interface DominoOp { - key: string; - input: string; - output: string; -} - -/** - * ProofOp defines an operation used for calculating Merkle root - * The data could be arbitrary format, providing nessecary data - * for example neighbouring node hash - */ -export interface ProofOp { - type: string; - key: Uint8Array; - data: Uint8Array; -} - -/** ProofOps is Merkle proof defined by the list of ProofOps */ -export interface ProofOps { - ops: ProofOp[]; -} - -const baseProof: object = { total: 0, index: 0 }; - -export const Proof = { - encode(message: Proof, writer: Writer = Writer.create()): Writer { - if (message.total !== 0) { - writer.uint32(8).int64(message.total); - } - if (message.index !== 0) { - writer.uint32(16).int64(message.index); - } - if (message.leaf_hash.length !== 0) { - writer.uint32(26).bytes(message.leaf_hash); - } - for (const v of message.aunts) { - writer.uint32(34).bytes(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Proof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProof } as Proof; - message.aunts = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = longToNumber(reader.int64() as Long); - break; - case 2: - message.index = longToNumber(reader.int64() as Long); - break; - case 3: - message.leaf_hash = reader.bytes(); - break; - case 4: - message.aunts.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = bytesFromBase64(object.leaf_hash); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(bytesFromBase64(e)); - } - } - return message; - }, - - toJSON(message: Proof): unknown { - const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.index !== undefined && (obj.index = message.index); - message.leaf_hash !== undefined && - (obj.leaf_hash = base64FromBytes( - message.leaf_hash !== undefined ? message.leaf_hash : new Uint8Array() - )); - if (message.aunts) { - obj.aunts = message.aunts.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.aunts = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = object.leaf_hash; - } else { - message.leaf_hash = new Uint8Array(); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(e); - } - } - return message; - }, -}; - -const baseValueOp: object = {}; - -export const ValueOp = { - encode(message: ValueOp, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValueOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValueOp } as ValueOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.proof = Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; - }, - - toJSON(message: ValueOp): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } - return message; - }, -}; - -const baseDominoOp: object = { key: "", input: "", output: "" }; - -export const DominoOp = { - encode(message: DominoOp, writer: Writer = Writer.create()): Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.input !== "") { - writer.uint32(18).string(message.input); - } - if (message.output !== "") { - writer.uint32(26).string(message.output); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DominoOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDominoOp } as DominoOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.input = reader.string(); - break; - case 3: - message.output = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = String(object.input); - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = String(object.output); - } else { - message.output = ""; - } - return message; - }, - - toJSON(message: DominoOp): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.input !== undefined && (obj.input = message.input); - message.output !== undefined && (obj.output = message.output); - return obj; - }, - - fromPartial(object: DeepPartial): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = object.input; - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = object.output; - } else { - message.output = ""; - } - return message; - }, -}; - -const baseProofOp: object = { type: "" }; - -export const ProofOp = { - encode(message: ProofOp, writer: Writer = Writer.create()): Writer { - if (message.type !== "") { - writer.uint32(10).string(message.type); - } - if (message.key.length !== 0) { - writer.uint32(18).bytes(message.key); - } - if (message.data.length !== 0) { - writer.uint32(26).bytes(message.data); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOp } as ProofOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.key = reader.bytes(); - break; - case 3: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - toJSON(message: ProofOp): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = message.type); - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, -}; - -const baseProofOps: object = {}; - -export const ProofOps = { - encode(message: ProofOps, writer: Writer = Writer.create()): Writer { - for (const v of message.ops) { - ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ops.push(ProofOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ProofOps): unknown { - const obj: any = {}; - if (message.ops) { - obj.ops = message.ops.map((e) => (e ? ProofOp.toJSON(e) : undefined)); - } else { - obj.ops = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromPartial(e)); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/types/types.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/types/types.ts deleted file mode 100644 index 59a41a8e..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/types/types.ts +++ /dev/null @@ -1,1943 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Proof } from "../../tendermint/crypto/proof"; -import { Consensus } from "../../tendermint/version/types"; -import { ValidatorSet } from "../../tendermint/types/validator"; - -export const protobufPackage = "tendermint.types"; - -/** BlockIdFlag indicates which BlcokID the signature is for */ -export enum BlockIDFlag { - BLOCK_ID_FLAG_UNKNOWN = 0, - BLOCK_ID_FLAG_ABSENT = 1, - BLOCK_ID_FLAG_COMMIT = 2, - BLOCK_ID_FLAG_NIL = 3, - UNRECOGNIZED = -1, -} - -export function blockIDFlagFromJSON(object: any): BlockIDFlag { - switch (object) { - case 0: - case "BLOCK_ID_FLAG_UNKNOWN": - return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; - case 1: - case "BLOCK_ID_FLAG_ABSENT": - return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; - case 2: - case "BLOCK_ID_FLAG_COMMIT": - return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; - case 3: - case "BLOCK_ID_FLAG_NIL": - return BlockIDFlag.BLOCK_ID_FLAG_NIL; - case -1: - case "UNRECOGNIZED": - default: - return BlockIDFlag.UNRECOGNIZED; - } -} - -export function blockIDFlagToJSON(object: BlockIDFlag): string { - switch (object) { - case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: - return "BLOCK_ID_FLAG_UNKNOWN"; - case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: - return "BLOCK_ID_FLAG_ABSENT"; - case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: - return "BLOCK_ID_FLAG_COMMIT"; - case BlockIDFlag.BLOCK_ID_FLAG_NIL: - return "BLOCK_ID_FLAG_NIL"; - default: - return "UNKNOWN"; - } -} - -/** SignedMsgType is a type of signed message in the consensus. */ -export enum SignedMsgType { - SIGNED_MSG_TYPE_UNKNOWN = 0, - /** SIGNED_MSG_TYPE_PREVOTE - Votes */ - SIGNED_MSG_TYPE_PREVOTE = 1, - SIGNED_MSG_TYPE_PRECOMMIT = 2, - /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */ - SIGNED_MSG_TYPE_PROPOSAL = 32, - UNRECOGNIZED = -1, -} - -export function signedMsgTypeFromJSON(object: any): SignedMsgType { - switch (object) { - case 0: - case "SIGNED_MSG_TYPE_UNKNOWN": - return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN; - case 1: - case "SIGNED_MSG_TYPE_PREVOTE": - return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE; - case 2: - case "SIGNED_MSG_TYPE_PRECOMMIT": - return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT; - case 32: - case "SIGNED_MSG_TYPE_PROPOSAL": - return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL; - case -1: - case "UNRECOGNIZED": - default: - return SignedMsgType.UNRECOGNIZED; - } -} - -export function signedMsgTypeToJSON(object: SignedMsgType): string { - switch (object) { - case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: - return "SIGNED_MSG_TYPE_UNKNOWN"; - case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: - return "SIGNED_MSG_TYPE_PREVOTE"; - case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: - return "SIGNED_MSG_TYPE_PRECOMMIT"; - case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: - return "SIGNED_MSG_TYPE_PROPOSAL"; - default: - return "UNKNOWN"; - } -} - -/** PartsetHeader */ -export interface PartSetHeader { - total: number; - hash: Uint8Array; -} - -export interface Part { - index: number; - bytes: Uint8Array; - proof: Proof | undefined; -} - -/** BlockID */ -export interface BlockID { - hash: Uint8Array; - part_set_header: PartSetHeader | undefined; -} - -/** Header defines the structure of a Tendermint block header. */ -export interface Header { - /** basic block info */ - version: Consensus | undefined; - chain_id: string; - height: number; - time: Date | undefined; - /** prev block info */ - last_block_id: BlockID | undefined; - /** hashes of block data */ - last_commit_hash: Uint8Array; - /** transactions */ - data_hash: Uint8Array; - /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; - /** validators for the next block */ - next_validators_hash: Uint8Array; - /** consensus params for current block */ - consensus_hash: Uint8Array; - /** state after txs from the previous block */ - app_hash: Uint8Array; - /** root hash of all results from the txs from the previous block */ - last_results_hash: Uint8Array; - /** consensus info */ - evidence_hash: Uint8Array; - /** original proposer of the block */ - proposer_address: Uint8Array; -} - -/** Data contains the set of transactions included in the block */ -export interface Data { - /** - * Txs that will be applied by state @ block.Height+1. - * NOTE: not all txs here are valid. We're just agreeing on the order first. - * This means that block.AppHash does not include these txs. - */ - txs: Uint8Array[]; -} - -/** - * Vote represents a prevote, precommit, or commit vote from validators for - * consensus. - */ -export interface Vote { - type: SignedMsgType; - height: number; - round: number; - /** zero if vote is nil. */ - block_id: BlockID | undefined; - timestamp: Date | undefined; - validator_address: Uint8Array; - validator_index: number; - signature: Uint8Array; -} - -/** Commit contains the evidence that a block was committed by a set of validators. */ -export interface Commit { - height: number; - round: number; - block_id: BlockID | undefined; - signatures: CommitSig[]; -} - -/** CommitSig is a part of the Vote included in a Commit. */ -export interface CommitSig { - block_id_flag: BlockIDFlag; - validator_address: Uint8Array; - timestamp: Date | undefined; - signature: Uint8Array; -} - -export interface Proposal { - type: SignedMsgType; - height: number; - round: number; - pol_round: number; - block_id: BlockID | undefined; - timestamp: Date | undefined; - signature: Uint8Array; -} - -export interface SignedHeader { - header: Header | undefined; - commit: Commit | undefined; -} - -export interface LightBlock { - signed_header: SignedHeader | undefined; - validator_set: ValidatorSet | undefined; -} - -export interface BlockMeta { - block_id: BlockID | undefined; - block_size: number; - header: Header | undefined; - num_txs: number; -} - -/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ -export interface TxProof { - root_hash: Uint8Array; - data: Uint8Array; - proof: Proof | undefined; -} - -const basePartSetHeader: object = { total: 0 }; - -export const PartSetHeader = { - encode(message: PartSetHeader, writer: Writer = Writer.create()): Writer { - if (message.total !== 0) { - writer.uint32(8).uint32(message.total); - } - if (message.hash.length !== 0) { - writer.uint32(18).bytes(message.hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PartSetHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePartSetHeader } as PartSetHeader; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = reader.uint32(); - break; - case 2: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; - }, - - toJSON(message: PartSetHeader): unknown { - const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - return message; - }, -}; - -const basePart: object = { index: 0 }; - -export const Part = { - encode(message: Part, writer: Writer = Writer.create()): Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - if (message.bytes.length !== 0) { - writer.uint32(18).bytes(message.bytes); - } - if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Part { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePart } as Part; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.bytes = reader.bytes(); - break; - case 3: - message.proof = Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = bytesFromBase64(object.bytes); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; - }, - - toJSON(message: Part): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.bytes !== undefined && - (obj.bytes = base64FromBytes( - message.bytes !== undefined ? message.bytes : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = object.bytes; - } else { - message.bytes = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } - return message; - }, -}; - -const baseBlockID: object = {}; - -export const BlockID = { - encode(message: BlockID, writer: Writer = Writer.create()): Writer { - if (message.hash.length !== 0) { - writer.uint32(10).bytes(message.hash); - } - if (message.part_set_header !== undefined) { - PartSetHeader.encode( - message.part_set_header, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BlockID { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockID } as BlockID; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - case 2: - message.part_set_header = PartSetHeader.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromJSON(object.part_set_header); - } else { - message.part_set_header = undefined; - } - return message; - }, - - toJSON(message: BlockID): unknown { - const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.part_set_header !== undefined && - (obj.part_set_header = message.part_set_header - ? PartSetHeader.toJSON(message.part_set_header) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromPartial( - object.part_set_header - ); - } else { - message.part_set_header = undefined; - } - return message; - }, -}; - -const baseHeader: object = { chain_id: "", height: 0 }; - -export const Header = { - encode(message: Header, writer: Writer = Writer.create()): Writer { - if (message.version !== undefined) { - Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); - } - if (message.chain_id !== "") { - writer.uint32(18).string(message.chain_id); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(34).fork() - ).ldelim(); - } - if (message.last_block_id !== undefined) { - BlockID.encode(message.last_block_id, writer.uint32(42).fork()).ldelim(); - } - if (message.last_commit_hash.length !== 0) { - writer.uint32(50).bytes(message.last_commit_hash); - } - if (message.data_hash.length !== 0) { - writer.uint32(58).bytes(message.data_hash); - } - if (message.validators_hash.length !== 0) { - writer.uint32(66).bytes(message.validators_hash); - } - if (message.next_validators_hash.length !== 0) { - writer.uint32(74).bytes(message.next_validators_hash); - } - if (message.consensus_hash.length !== 0) { - writer.uint32(82).bytes(message.consensus_hash); - } - if (message.app_hash.length !== 0) { - writer.uint32(90).bytes(message.app_hash); - } - if (message.last_results_hash.length !== 0) { - writer.uint32(98).bytes(message.last_results_hash); - } - if (message.evidence_hash.length !== 0) { - writer.uint32(106).bytes(message.evidence_hash); - } - if (message.proposer_address.length !== 0) { - writer.uint32(114).bytes(message.proposer_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Header { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeader } as Header; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = Consensus.decode(reader, reader.uint32()); - break; - case 2: - message.chain_id = reader.string(); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 5: - message.last_block_id = BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.last_commit_hash = reader.bytes(); - break; - case 7: - message.data_hash = reader.bytes(); - break; - case 8: - message.validators_hash = reader.bytes(); - break; - case 9: - message.next_validators_hash = reader.bytes(); - break; - case 10: - message.consensus_hash = reader.bytes(); - break; - case 11: - message.app_hash = reader.bytes(); - break; - case 12: - message.last_results_hash = reader.bytes(); - break; - case 13: - message.evidence_hash = reader.bytes(); - break; - case 14: - message.proposer_address = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromJSON(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromJSON(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = bytesFromBase64(object.last_commit_hash); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = bytesFromBase64(object.data_hash); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = bytesFromBase64(object.validators_hash); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = bytesFromBase64( - object.next_validators_hash - ); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = bytesFromBase64(object.consensus_hash); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = bytesFromBase64(object.last_results_hash); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = bytesFromBase64(object.evidence_hash); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = bytesFromBase64(object.proposer_address); - } - return message; - }, - - toJSON(message: Header): unknown { - const obj: any = {}; - message.version !== undefined && - (obj.version = message.version - ? Consensus.toJSON(message.version) - : undefined); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.last_block_id !== undefined && - (obj.last_block_id = message.last_block_id - ? BlockID.toJSON(message.last_block_id) - : undefined); - message.last_commit_hash !== undefined && - (obj.last_commit_hash = base64FromBytes( - message.last_commit_hash !== undefined - ? message.last_commit_hash - : new Uint8Array() - )); - message.data_hash !== undefined && - (obj.data_hash = base64FromBytes( - message.data_hash !== undefined ? message.data_hash : new Uint8Array() - )); - message.validators_hash !== undefined && - (obj.validators_hash = base64FromBytes( - message.validators_hash !== undefined - ? message.validators_hash - : new Uint8Array() - )); - message.next_validators_hash !== undefined && - (obj.next_validators_hash = base64FromBytes( - message.next_validators_hash !== undefined - ? message.next_validators_hash - : new Uint8Array() - )); - message.consensus_hash !== undefined && - (obj.consensus_hash = base64FromBytes( - message.consensus_hash !== undefined - ? message.consensus_hash - : new Uint8Array() - )); - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() - )); - message.last_results_hash !== undefined && - (obj.last_results_hash = base64FromBytes( - message.last_results_hash !== undefined - ? message.last_results_hash - : new Uint8Array() - )); - message.evidence_hash !== undefined && - (obj.evidence_hash = base64FromBytes( - message.evidence_hash !== undefined - ? message.evidence_hash - : new Uint8Array() - )); - message.proposer_address !== undefined && - (obj.proposer_address = base64FromBytes( - message.proposer_address !== undefined - ? message.proposer_address - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial
): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromPartial(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromPartial(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = object.last_commit_hash; - } else { - message.last_commit_hash = new Uint8Array(); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = object.data_hash; - } else { - message.data_hash = new Uint8Array(); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = object.validators_hash; - } else { - message.validators_hash = new Uint8Array(); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = object.next_validators_hash; - } else { - message.next_validators_hash = new Uint8Array(); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = object.consensus_hash; - } else { - message.consensus_hash = new Uint8Array(); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = object.last_results_hash; - } else { - message.last_results_hash = new Uint8Array(); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = object.evidence_hash; - } else { - message.evidence_hash = new Uint8Array(); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = object.proposer_address; - } else { - message.proposer_address = new Uint8Array(); - } - return message; - }, -}; - -const baseData: object = {}; - -export const Data = { - encode(message: Data, writer: Writer = Writer.create()): Writer { - for (const v of message.txs) { - writer.uint32(10).bytes(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Data { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseData } as Data; - message.txs = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.txs.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(bytesFromBase64(e)); - } - } - return message; - }, - - toJSON(message: Data): unknown { - const obj: any = {}; - if (message.txs) { - obj.txs = message.txs.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.txs = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(e); - } - } - return message; - }, -}; - -const baseVote: object = { type: 0, height: 0, round: 0, validator_index: 0 }; - -export const Vote = { - encode(message: Vote, writer: Writer = Writer.create()): Writer { - if (message.type !== 0) { - writer.uint32(8).int32(message.type); - } - if (message.height !== 0) { - writer.uint32(16).int64(message.height); - } - if (message.round !== 0) { - writer.uint32(24).int32(message.round); - } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(34).fork()).ldelim(); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); - } - if (message.validator_address.length !== 0) { - writer.uint32(50).bytes(message.validator_address); - } - if (message.validator_index !== 0) { - writer.uint32(56).int32(message.validator_index); - } - if (message.signature.length !== 0) { - writer.uint32(66).bytes(message.signature); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVote } as Vote; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32() as any; - break; - case 2: - message.height = longToNumber(reader.int64() as Long); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 6: - message.validator_address = reader.bytes(); - break; - case 7: - message.validator_index = reader.int32(); - break; - case 8: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = Number(object.validator_index); - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: Vote): unknown { - const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.validator_index !== undefined && - (obj.validator_index = message.validator_index); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = object.validator_index; - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseCommit: object = { height: 0, round: 0 }; - -export const Commit = { - encode(message: Commit, writer: Writer = Writer.create()): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - if (message.round !== 0) { - writer.uint32(16).int32(message.round); - } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.signatures) { - CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Commit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommit } as Commit; - message.signatures = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - case 2: - message.round = reader.int32(); - break; - case 3: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 4: - message.signatures.push(CommitSig.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Commit): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? CommitSig.toJSON(e) : undefined - ); - } else { - obj.signatures = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCommitSig: object = { block_id_flag: 0 }; - -export const CommitSig = { - encode(message: CommitSig, writer: Writer = Writer.create()): Writer { - if (message.block_id_flag !== 0) { - writer.uint32(8).int32(message.block_id_flag); - } - if (message.validator_address.length !== 0) { - writer.uint32(18).bytes(message.validator_address); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(26).fork() - ).ldelim(); - } - if (message.signature.length !== 0) { - writer.uint32(34).bytes(message.signature); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CommitSig { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommitSig } as CommitSig; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id_flag = reader.int32() as any; - break; - case 2: - message.validator_address = reader.bytes(); - break; - case 3: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 4: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = blockIDFlagFromJSON(object.block_id_flag); - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: CommitSig): unknown { - const obj: any = {}; - message.block_id_flag !== undefined && - (obj.block_id_flag = blockIDFlagToJSON(message.block_id_flag)); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = object.block_id_flag; - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseProposal: object = { type: 0, height: 0, round: 0, pol_round: 0 }; - -export const Proposal = { - encode(message: Proposal, writer: Writer = Writer.create()): Writer { - if (message.type !== 0) { - writer.uint32(8).int32(message.type); - } - if (message.height !== 0) { - writer.uint32(16).int64(message.height); - } - if (message.round !== 0) { - writer.uint32(24).int32(message.round); - } - if (message.pol_round !== 0) { - writer.uint32(32).int32(message.pol_round); - } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(42).fork()).ldelim(); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(50).fork() - ).ldelim(); - } - if (message.signature.length !== 0) { - writer.uint32(58).bytes(message.signature); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProposal } as Proposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32() as any; - break; - case 2: - message.height = longToNumber(reader.int64() as Long); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.pol_round = reader.int32(); - break; - case 5: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 7: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = Number(object.pol_round); - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: Proposal): unknown { - const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.pol_round !== undefined && (obj.pol_round = message.pol_round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = object.pol_round; - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseSignedHeader: object = {}; - -export const SignedHeader = { - encode(message: SignedHeader, writer: Writer = Writer.create()): Writer { - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(10).fork()).ldelim(); - } - if (message.commit !== undefined) { - Commit.encode(message.commit, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SignedHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignedHeader } as SignedHeader; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = Header.decode(reader, reader.uint32()); - break; - case 2: - message.commit = Commit.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - return message; - }, - - toJSON(message: SignedHeader): unknown { - const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.commit !== undefined && - (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromPartial(object.commit); - } else { - message.commit = undefined; - } - return message; - }, -}; - -const baseLightBlock: object = {}; - -export const LightBlock = { - encode(message: LightBlock, writer: Writer = Writer.create()): Writer { - if (message.signed_header !== undefined) { - SignedHeader.encode( - message.signed_header, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.validator_set !== undefined) { - ValidatorSet.encode( - message.validator_set, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): LightBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLightBlock } as LightBlock; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signed_header = SignedHeader.decode(reader, reader.uint32()); - break; - case 2: - message.validator_set = ValidatorSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromJSON(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromJSON(object.validator_set); - } else { - message.validator_set = undefined; - } - return message; - }, - - toJSON(message: LightBlock): unknown { - const obj: any = {}; - message.signed_header !== undefined && - (obj.signed_header = message.signed_header - ? SignedHeader.toJSON(message.signed_header) - : undefined); - message.validator_set !== undefined && - (obj.validator_set = message.validator_set - ? ValidatorSet.toJSON(message.validator_set) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromPartial(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromPartial(object.validator_set); - } else { - message.validator_set = undefined; - } - return message; - }, -}; - -const baseBlockMeta: object = { block_size: 0, num_txs: 0 }; - -export const BlockMeta = { - encode(message: BlockMeta, writer: Writer = Writer.create()): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); - } - if (message.block_size !== 0) { - writer.uint32(16).int64(message.block_size); - } - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(26).fork()).ldelim(); - } - if (message.num_txs !== 0) { - writer.uint32(32).int64(message.num_txs); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BlockMeta { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockMeta } as BlockMeta; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 2: - message.block_size = longToNumber(reader.int64() as Long); - break; - case 3: - message.header = Header.decode(reader, reader.uint32()); - break; - case 4: - message.num_txs = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = Number(object.block_size); - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = Number(object.num_txs); - } else { - message.num_txs = 0; - } - return message; - }, - - toJSON(message: BlockMeta): unknown { - const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block_size !== undefined && (obj.block_size = message.block_size); - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.num_txs !== undefined && (obj.num_txs = message.num_txs); - return obj; - }, - - fromPartial(object: DeepPartial): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = object.block_size; - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = object.num_txs; - } else { - message.num_txs = 0; - } - return message; - }, -}; - -const baseTxProof: object = {}; - -export const TxProof = { - encode(message: TxProof, writer: Writer = Writer.create()): Writer { - if (message.root_hash.length !== 0) { - writer.uint32(10).bytes(message.root_hash); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TxProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxProof } as TxProof; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.root_hash = reader.bytes(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.proof = Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = bytesFromBase64(object.root_hash); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; - }, - - toJSON(message: TxProof): unknown { - const obj: any = {}; - message.root_hash !== undefined && - (obj.root_hash = base64FromBytes( - message.root_hash !== undefined ? message.root_hash : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = object.root_hash; - } else { - message.root_hash = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/types/validator.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/types/validator.ts deleted file mode 100644 index 8c3581c1..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/types/validator.ts +++ /dev/null @@ -1,382 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { PublicKey } from "../../tendermint/crypto/keys"; - -export const protobufPackage = "tendermint.types"; - -export interface ValidatorSet { - validators: Validator[]; - proposer: Validator | undefined; - total_voting_power: number; -} - -export interface Validator { - address: Uint8Array; - pub_key: PublicKey | undefined; - voting_power: number; - proposer_priority: number; -} - -export interface SimpleValidator { - pub_key: PublicKey | undefined; - voting_power: number; -} - -const baseValidatorSet: object = { total_voting_power: 0 }; - -export const ValidatorSet = { - encode(message: ValidatorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.validators) { - Validator.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.proposer !== undefined) { - Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); - } - if (message.total_voting_power !== 0) { - writer.uint32(24).int64(message.total_voting_power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; - case 2: - message.proposer = Validator.decode(reader, reader.uint32()); - break; - case 3: - message.total_voting_power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromJSON(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - return message; - }, - - toJSON(message: ValidatorSet): unknown { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.proposer !== undefined && - (obj.proposer = message.proposer - ? Validator.toJSON(message.proposer) - : undefined); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - return obj; - }, - - fromPartial(object: DeepPartial): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromPartial(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - return message; - }, -}; - -const baseValidator: object = { voting_power: 0, proposer_priority: 0 }; - -export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { - if (message.address.length !== 0) { - writer.uint32(10).bytes(message.address); - } - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); - } - if (message.voting_power !== 0) { - writer.uint32(24).int64(message.voting_power); - } - if (message.proposer_priority !== 0) { - writer.uint32(32).int64(message.proposer_priority); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.bytes(); - break; - case 2: - message.pub_key = PublicKey.decode(reader, reader.uint32()); - break; - case 3: - message.voting_power = longToNumber(reader.int64() as Long); - break; - case 4: - message.proposer_priority = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = Number(object.proposer_priority); - } else { - message.proposer_priority = 0; - } - return message; - }, - - toJSON(message: Validator): unknown { - const obj: any = {}; - message.address !== undefined && - (obj.address = base64FromBytes( - message.address !== undefined ? message.address : new Uint8Array() - )); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - message.proposer_priority !== undefined && - (obj.proposer_priority = message.proposer_priority); - return obj; - }, - - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = new Uint8Array(); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = object.proposer_priority; - } else { - message.proposer_priority = 0; - } - return message; - }, -}; - -const baseSimpleValidator: object = { voting_power: 0 }; - -export const SimpleValidator = { - encode(message: SimpleValidator, writer: Writer = Writer.create()): Writer { - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(10).fork()).ldelim(); - } - if (message.voting_power !== 0) { - writer.uint32(16).int64(message.voting_power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SimpleValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimpleValidator } as SimpleValidator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pub_key = PublicKey.decode(reader, reader.uint32()); - break; - case 2: - message.voting_power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - return message; - }, - - toJSON(message: SimpleValidator): unknown { - const obj: any = {}; - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - return obj; - }, - - fromPartial(object: DeepPartial): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/version/types.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/version/types.ts deleted file mode 100644 index 4bc6ad82..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/types/tendermint/version/types.ts +++ /dev/null @@ -1,202 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.version"; - -/** - * App includes the protocol and software version for the application. - * This information is included in ResponseInfo. The App.Protocol can be - * updated in ResponseEndBlock. - */ -export interface App { - protocol: number; - software: string; -} - -/** - * Consensus captures the consensus rules for processing a block in the blockchain, - * including all blockchain data structures and the rules of the application's - * state transition machine. - */ -export interface Consensus { - block: number; - app: number; -} - -const baseApp: object = { protocol: 0, software: "" }; - -export const App = { - encode(message: App, writer: Writer = Writer.create()): Writer { - if (message.protocol !== 0) { - writer.uint32(8).uint64(message.protocol); - } - if (message.software !== "") { - writer.uint32(18).string(message.software); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): App { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseApp } as App; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.protocol = longToNumber(reader.uint64() as Long); - break; - case 2: - message.software = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = Number(object.protocol); - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = String(object.software); - } else { - message.software = ""; - } - return message; - }, - - toJSON(message: App): unknown { - const obj: any = {}; - message.protocol !== undefined && (obj.protocol = message.protocol); - message.software !== undefined && (obj.software = message.software); - return obj; - }, - - fromPartial(object: DeepPartial): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = object.protocol; - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = object.software; - } else { - message.software = ""; - } - return message; - }, -}; - -const baseConsensus: object = { block: 0, app: 0 }; - -export const Consensus = { - encode(message: Consensus, writer: Writer = Writer.create()): Writer { - if (message.block !== 0) { - writer.uint32(8).uint64(message.block); - } - if (message.app !== 0) { - writer.uint32(16).uint64(message.app); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Consensus { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensus } as Consensus; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = longToNumber(reader.uint64() as Long); - break; - case 2: - message.app = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = Number(object.block); - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = Number(object.app); - } else { - message.app = 0; - } - return message; - }, - - toJSON(message: Consensus): unknown { - const obj: any = {}; - message.block !== undefined && (obj.block = message.block); - message.app !== undefined && (obj.app = message.app); - return obj; - }, - - fromPartial(object: DeepPartial): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = object.block; - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = object.app; - } else { - message.app = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/package.json deleted file mode 100644 index c7a239aa..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-staking-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.staking.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/staking/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.staking.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/index.ts deleted file mode 100644 index 5ddbc5aa..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/index.ts +++ /dev/null @@ -1,250 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { Tx } from "./module/types/cosmos/tx/v1beta1/tx" -import { TxRaw } from "./module/types/cosmos/tx/v1beta1/tx" -import { SignDoc } from "./module/types/cosmos/tx/v1beta1/tx" -import { TxBody } from "./module/types/cosmos/tx/v1beta1/tx" -import { AuthInfo } from "./module/types/cosmos/tx/v1beta1/tx" -import { SignerInfo } from "./module/types/cosmos/tx/v1beta1/tx" -import { ModeInfo } from "./module/types/cosmos/tx/v1beta1/tx" -import { ModeInfo_Single } from "./module/types/cosmos/tx/v1beta1/tx" -import { ModeInfo_Multi } from "./module/types/cosmos/tx/v1beta1/tx" -import { Fee } from "./module/types/cosmos/tx/v1beta1/tx" - - -export { Tx, TxRaw, SignDoc, TxBody, AuthInfo, SignerInfo, ModeInfo, ModeInfo_Single, ModeInfo_Multi, Fee }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Simulate: {}, - GetTx: {}, - BroadcastTx: {}, - GetTxsEvent: {}, - - _Structure: { - Tx: getStructure(Tx.fromPartial({})), - TxRaw: getStructure(TxRaw.fromPartial({})), - SignDoc: getStructure(SignDoc.fromPartial({})), - TxBody: getStructure(TxBody.fromPartial({})), - AuthInfo: getStructure(AuthInfo.fromPartial({})), - SignerInfo: getStructure(SignerInfo.fromPartial({})), - ModeInfo: getStructure(ModeInfo.fromPartial({})), - ModeInfo_Single: getStructure(ModeInfo_Single.fromPartial({})), - ModeInfo_Multi: getStructure(ModeInfo_Multi.fromPartial({})), - Fee: getStructure(Fee.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getSimulate: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Simulate[JSON.stringify(params)] ?? {} - }, - getGetTx: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetTx[JSON.stringify(params)] ?? {} - }, - getBroadcastTx: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.BroadcastTx[JSON.stringify(params)] ?? {} - }, - getGetTxsEvent: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.GetTxsEvent[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.tx.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async ServiceSimulate({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceSimulate({...key})).data - - - commit('QUERY', { query: 'Simulate', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceSimulate', payload: { options: { all }, params: {...key},query }}) - return getters['getSimulate']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceSimulate API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetTx({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceGetTx( key.hash)).data - - - commit('QUERY', { query: 'GetTx', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetTx', payload: { options: { all }, params: {...key},query }}) - return getters['getGetTx']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetTx API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceBroadcastTx({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceBroadcastTx({...key})).data - - - commit('QUERY', { query: 'BroadcastTx', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceBroadcastTx', payload: { options: { all }, params: {...key},query }}) - return getters['getBroadcastTx']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceBroadcastTx API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async ServiceGetTxsEvent({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.serviceGetTxsEvent(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.serviceGetTxsEvent({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'GetTxsEvent', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'ServiceGetTxsEvent', payload: { options: { all }, params: {...key},query }}) - return getters['getGetTxsEvent']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:ServiceGetTxsEvent API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/rest.ts deleted file mode 100644 index 2ceb34f4..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/rest.ts +++ /dev/null @@ -1,950 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* Event allows application developers to attach additional information to -ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. -Later, transactions may be queried using these events. -*/ -export interface AbciEvent { - type?: string; - attributes?: AbciEventAttribute[]; -} - -/** - * EventAttribute is a single key-value pair, associated with an event. - */ -export interface AbciEventAttribute { - /** @format byte */ - key?: string; - - /** @format byte */ - value?: string; - index?: boolean; -} - -/** - * Result is the union of ResponseFormat and ResponseCheckTx. - */ -export interface Abciv1Beta1Result { - /** - * Data is any data returned from message or handler execution. It MUST be - * length prefixed in order to separate data from multiple message executions. - * @format byte - */ - data?: string; - - /** Log contains the log information from message or handler execution. */ - log?: string; - - /** - * Events contains a slice of Event objects that were emitted during message - * or handler execution. - */ - events?: AbciEvent[]; -} - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** - * ABCIMessageLog defines a structure containing an indexed tx ABCI message log. - */ -export interface V1Beta1ABCIMessageLog { - /** @format int64 */ - msg_index?: number; - log?: string; - - /** - * Events contains a slice of Event objects that were emitted during some - * execution. - */ - events?: V1Beta1StringEvent[]; -} - -/** -* Attribute defines an attribute wrapper where the key and value are -strings instead of raw bytes. -*/ -export interface V1Beta1Attribute { - key?: string; - value?: string; -} - -/** -* AuthInfo describes the fee and signer modes that are used to sign a -transaction. -*/ -export interface V1Beta1AuthInfo { - /** - * signer_infos defines the signing modes for the required signers. The number - * and order of elements must match the required signers from TxBody's - * messages. The first element is the primary signer and the one which pays - * the fee. - */ - signer_infos?: V1Beta1SignerInfo[]; - - /** - * Fee is the fee and gas limit for the transaction. The first signer is the - * primary signer and the one which pays the fee. The fee can be calculated - * based on the cost of evaluating the body and doing signature verification - * of the signers. This can be estimated via simulation. - */ - fee?: V1Beta1Fee; -} - -/** -* BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. - - - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for -the tx to be committed in a block. - - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for -a CheckTx execution response only. - - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns -immediately. -*/ -export enum V1Beta1BroadcastMode { - BROADCAST_MODE_UNSPECIFIED = "BROADCAST_MODE_UNSPECIFIED", - BROADCAST_MODE_BLOCK = "BROADCAST_MODE_BLOCK", - BROADCAST_MODE_SYNC = "BROADCAST_MODE_SYNC", - BROADCAST_MODE_ASYNC = "BROADCAST_MODE_ASYNC", -} - -/** -* BroadcastTxRequest is the request type for the Service.BroadcastTxRequest -RPC method. -*/ -export interface V1Beta1BroadcastTxRequest { - /** - * tx_bytes is the raw transaction. - * @format byte - */ - tx_bytes?: string; - - /** - * BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. - * - * - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - * - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - * the tx to be committed in a block. - * - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - * a CheckTx execution response only. - * - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - * immediately. - */ - mode?: V1Beta1BroadcastMode; -} - -/** -* BroadcastTxResponse is the response type for the -Service.BroadcastTx method. -*/ -export interface V1Beta1BroadcastTxResponse { - /** tx_response is the queried TxResponses. */ - tx_response?: V1Beta1TxResponse; -} - -/** -* 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 V1Beta1Coin { - denom?: string; - amount?: string; -} - -/** -* CompactBitArray is an implementation of a space efficient bit array. -This is used to ensure that the encoded data takes up a minimal amount of -space after proto encoding. -This is not thread safe, and is not intended for concurrent usage. -*/ -export interface V1Beta1CompactBitArray { - /** @format int64 */ - extra_bits_stored?: number; - - /** @format byte */ - elems?: string; -} - -/** -* Fee includes the amount of coins paid in fees and the maximum -gas to be used by the transaction. The ratio yields an effective "gasprice", -which must be above some miminum to be accepted into the mempool. -*/ -export interface V1Beta1Fee { - amount?: V1Beta1Coin[]; - - /** @format uint64 */ - gas_limit?: string; - - /** - * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - * the payer must be a tx signer (and thus have signed this field in AuthInfo). - * setting this field does *not* change the ordering of required signers for the transaction. - */ - payer?: string; - granter?: string; -} - -/** - * GasInfo defines tx execution gas context. - */ -export interface V1Beta1GasInfo { - /** - * GasWanted is the maximum units of work we allow this tx to perform. - * @format uint64 - */ - gas_wanted?: string; - - /** - * GasUsed is the amount of gas actually consumed. - * @format uint64 - */ - gas_used?: string; -} - -/** - * GetTxResponse is the response type for the Service.GetTx method. - */ -export interface V1Beta1GetTxResponse { - /** tx is the queried transaction. */ - tx?: V1Beta1Tx; - - /** tx_response is the queried TxResponses. */ - tx_response?: V1Beta1TxResponse; -} - -/** -* GetTxsEventResponse is the response type for the Service.TxsByEvents -RPC method. -*/ -export interface V1Beta1GetTxsEventResponse { - /** txs is the list of queried transactions. */ - txs?: V1Beta1Tx[]; - - /** tx_responses is the list of queried TxResponses. */ - tx_responses?: V1Beta1TxResponse[]; - - /** pagination defines an pagination for the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * ModeInfo describes the signing mode of a single or nested multisig signer. - */ -export interface V1Beta1ModeInfo { - single?: V1Beta1ModeInfoSingle; - multi?: V1Beta1ModeInfoMulti; -} - -export interface V1Beta1ModeInfoMulti { - /** - * CompactBitArray is an implementation of a space efficient bit array. - * This is used to ensure that the encoded data takes up a minimal amount of - * space after proto encoding. - * This is not thread safe, and is not intended for concurrent usage. - */ - bitarray?: V1Beta1CompactBitArray; - mode_infos?: V1Beta1ModeInfo[]; -} - -export interface V1Beta1ModeInfoSingle { - /** - * SignMode represents a signing mode with its own security guarantees. - * - * - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - * rejected - * - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - * verified with raw bytes from Tx - * - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some - * human-readable textual representation on top of the binary representation - * from SIGN_MODE_DIRECT - * - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - * Amino JSON and will be removed in the future - */ - mode?: V1Beta1SignMode; -} - -/** -* - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. - - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order - - ORDER_BY_DESC: ORDER_BY_DESC defines descending order -*/ -export enum V1Beta1OrderBy { - ORDER_BY_UNSPECIFIED = "ORDER_BY_UNSPECIFIED", - ORDER_BY_ASC = "ORDER_BY_ASC", - ORDER_BY_DESC = "ORDER_BY_DESC", -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** -* SignMode represents a signing mode with its own security guarantees. - - - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be -rejected - - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is -verified with raw bytes from Tx - - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some -human-readable textual representation on top of the binary representation -from SIGN_MODE_DIRECT - - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses -Amino JSON and will be removed in the future -*/ -export enum V1Beta1SignMode { - SIGN_MODE_UNSPECIFIED = "SIGN_MODE_UNSPECIFIED", - SIGN_MODE_DIRECT = "SIGN_MODE_DIRECT", - SIGN_MODE_TEXTUAL = "SIGN_MODE_TEXTUAL", - SIGN_MODE_LEGACY_AMINO_JSON = "SIGN_MODE_LEGACY_AMINO_JSON", -} - -/** -* SignerInfo describes the public key and signing mode of a single top-level -signer. -*/ -export interface V1Beta1SignerInfo { - /** - * public_key is the public key of the signer. It is optional for accounts - * that already exist in state. If unset, the verifier can use the required \ - * signer address for this position and lookup the public key. - */ - public_key?: ProtobufAny; - - /** ModeInfo describes the signing mode of a single or nested multisig signer. */ - mode_info?: V1Beta1ModeInfo; - - /** - * sequence is the sequence of the account, which describes the - * number of committed transactions signed by a given address. It is used to - * prevent replay attacks. - * @format uint64 - */ - sequence?: string; -} - -/** -* SimulateRequest is the request type for the Service.Simulate -RPC method. -*/ -export interface V1Beta1SimulateRequest { - /** - * tx is the transaction to simulate. - * Deprecated. Send raw tx bytes instead. - */ - tx?: V1Beta1Tx; - - /** - * tx_bytes is the raw transaction. - * - * Since: cosmos-sdk 0.43 - * @format byte - */ - tx_bytes?: string; -} - -/** -* SimulateResponse is the response type for the -Service.SimulateRPC method. -*/ -export interface V1Beta1SimulateResponse { - /** gas_info is the information about gas used in the simulation. */ - gas_info?: V1Beta1GasInfo; - - /** result is the result of the simulation. */ - result?: Abciv1Beta1Result; -} - -/** -* StringEvent defines en Event object wrapper where all the attributes -contain key/value pairs that are strings instead of raw bytes. -*/ -export interface V1Beta1StringEvent { - type?: string; - attributes?: V1Beta1Attribute[]; -} - -/** - * Tx is the standard type used for broadcasting transactions. - */ -export interface V1Beta1Tx { - /** TxBody is the body of a transaction that all signers sign over. */ - body?: V1Beta1TxBody; - - /** - * AuthInfo describes the fee and signer modes that are used to sign a - * transaction. - */ - auth_info?: V1Beta1AuthInfo; - - /** - * signatures is a list of signatures that matches the length and order of - * AuthInfo's signer_infos to allow connecting signature meta information like - * public key and signing mode by position. - */ - signatures?: string[]; -} - -/** - * TxBody is the body of a transaction that all signers sign over. - */ -export interface V1Beta1TxBody { - /** - * messages is a list of messages to be executed. The required signers of - * those messages define the number and order of elements in AuthInfo's - * signer_infos and Tx's signatures. Each required signer address is added to - * the list only the first time it occurs. - * By convention, the first required signer (usually from the first message) - * is referred to as the primary signer and pays the fee for the whole - * transaction. - */ - messages?: ProtobufAny[]; - - /** - * memo is any arbitrary note/comment to be added to the transaction. - * WARNING: in clients, any publicly exposed text should not be called memo, - * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). - */ - memo?: string; - - /** @format uint64 */ - timeout_height?: string; - extension_options?: ProtobufAny[]; - non_critical_extension_options?: ProtobufAny[]; -} - -/** -* TxResponse defines a structure containing relevant tx data and metadata. The -tags are stringified and the log is JSON decoded. -*/ -export interface V1Beta1TxResponse { - /** @format int64 */ - height?: string; - - /** The transaction hash. */ - txhash?: string; - codespace?: string; - - /** - * Response code. - * @format int64 - */ - code?: number; - - /** Result bytes, if any. */ - data?: string; - - /** - * The output of the application's logger (raw string). May be - * non-deterministic. - */ - raw_log?: string; - - /** The output of the application's logger (typed). May be non-deterministic. */ - logs?: V1Beta1ABCIMessageLog[]; - - /** Additional information. May be non-deterministic. */ - info?: string; - - /** - * Amount of gas requested for transaction. - * @format int64 - */ - gas_wanted?: string; - - /** - * Amount of gas consumed by transaction. - * @format int64 - */ - gas_used?: string; - - /** The request transaction bytes. */ - tx?: ProtobufAny; - - /** - * Time of the previous block. For heights > 1, it's the weighted median of - * the timestamps of the valid votes in the block.LastCommit. For height == 1, - * it's genesis time. - */ - timestamp?: string; - - /** - * Events defines all the events emitted by processing a transaction. Note, - * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with - * additional metadata, emitted only by processing the messages. - * - * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - */ - events?: AbciEvent[]; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/tx/v1beta1/service.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Service - * @name ServiceSimulate - * @summary Simulate simulates executing a transaction for estimating gas usage. - * @request POST:/cosmos/tx/v1beta1/simulate - */ - serviceSimulate = (body: V1Beta1SimulateRequest, params: RequestParams = {}) => - this.request({ - path: `/cosmos/tx/v1beta1/simulate`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Service - * @name ServiceGetTxsEvent - * @summary GetTxsEvent fetches txs by event. - * @request GET:/cosmos/tx/v1beta1/txs - */ - serviceGetTxsEvent = ( - query?: { - events?: string[]; - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; - order_by?: "ORDER_BY_UNSPECIFIED" | "ORDER_BY_ASC" | "ORDER_BY_DESC"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/cosmos/tx/v1beta1/txs`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Service - * @name ServiceBroadcastTx - * @summary BroadcastTx broadcast transaction. - * @request POST:/cosmos/tx/v1beta1/txs - */ - serviceBroadcastTx = (body: V1Beta1BroadcastTxRequest, params: RequestParams = {}) => - this.request({ - path: `/cosmos/tx/v1beta1/txs`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Service - * @name ServiceGetTx - * @summary GetTx fetches a tx by hash. - * @request GET:/cosmos/tx/v1beta1/txs/{hash} - */ - serviceGetTx = (hash: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/tx/v1beta1/txs/${hash}`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/base/abci/v1beta1/abci.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/base/abci/v1beta1/abci.ts deleted file mode 100644 index 3498e6b9..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/base/abci/v1beta1/abci.ts +++ /dev/null @@ -1,1281 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { Event } from "../../../../tendermint/abci/types"; - -export const protobufPackage = "cosmos.base.abci.v1beta1"; - -/** - * TxResponse defines a structure containing relevant tx data and metadata. The - * tags are stringified and the log is JSON decoded. - */ -export interface TxResponse { - /** The block height */ - height: number; - /** The transaction hash. */ - txhash: string; - /** Namespace for the Code */ - codespace: string; - /** Response code. */ - code: number; - /** Result bytes, if any. */ - data: string; - /** - * The output of the application's logger (raw string). May be - * non-deterministic. - */ - raw_log: string; - /** The output of the application's logger (typed). May be non-deterministic. */ - logs: ABCIMessageLog[]; - /** Additional information. May be non-deterministic. */ - info: string; - /** Amount of gas requested for transaction. */ - gas_wanted: number; - /** Amount of gas consumed by transaction. */ - gas_used: number; - /** The request transaction bytes. */ - tx: Any | undefined; - /** - * Time of the previous block. For heights > 1, it's the weighted median of - * the timestamps of the valid votes in the block.LastCommit. For height == 1, - * it's genesis time. - */ - timestamp: string; - /** - * Events defines all the events emitted by processing a transaction. Note, - * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with - * additional metadata, emitted only by processing the messages. - * - * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - */ - events: Event[]; -} - -/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ -export interface ABCIMessageLog { - msg_index: number; - log: string; - /** - * Events contains a slice of Event objects that were emitted during some - * execution. - */ - events: StringEvent[]; -} - -/** - * StringEvent defines en Event object wrapper where all the attributes - * contain key/value pairs that are strings instead of raw bytes. - */ -export interface StringEvent { - type: string; - attributes: Attribute[]; -} - -/** - * Attribute defines an attribute wrapper where the key and value are - * strings instead of raw bytes. - */ -export interface Attribute { - key: string; - value: string; -} - -/** GasInfo defines tx execution gas context. */ -export interface GasInfo { - /** GasWanted is the maximum units of work we allow this tx to perform. */ - gas_wanted: number; - /** GasUsed is the amount of gas actually consumed. */ - gas_used: number; -} - -/** Result is the union of ResponseFormat and ResponseCheckTx. */ -export interface Result { - /** - * Data is any data returned from message or handler execution. It MUST be - * length prefixed in order to separate data from multiple message executions. - */ - data: Uint8Array; - /** Log contains the log information from message or handler execution. */ - log: string; - /** - * Events contains a slice of Event objects that were emitted during message - * or handler execution. - */ - events: Event[]; -} - -/** - * SimulationResponse defines the response generated when a transaction is - * successfully simulated. - */ -export interface SimulationResponse { - gas_info: GasInfo | undefined; - result: Result | undefined; -} - -/** - * MsgData defines the data returned in a Result object during message - * execution. - */ -export interface MsgData { - msg_type: string; - data: Uint8Array; -} - -/** - * TxMsgData defines a list of MsgData. A transaction will have a MsgData object - * for each message. - */ -export interface TxMsgData { - data: MsgData[]; -} - -/** SearchTxsResult defines a structure for querying txs pageable */ -export interface SearchTxsResult { - /** Count of all txs */ - total_count: number; - /** Count of txs in current page */ - count: number; - /** Index of current page, start from 1 */ - page_number: number; - /** Count of total pages */ - page_total: number; - /** Max count txs per page */ - limit: number; - /** List of txs in current page */ - txs: TxResponse[]; -} - -const baseTxResponse: object = { - height: 0, - txhash: "", - codespace: "", - code: 0, - data: "", - raw_log: "", - info: "", - gas_wanted: 0, - gas_used: 0, - timestamp: "", -}; - -export const TxResponse = { - encode(message: TxResponse, writer: Writer = Writer.create()): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - if (message.txhash !== "") { - writer.uint32(18).string(message.txhash); - } - if (message.codespace !== "") { - writer.uint32(26).string(message.codespace); - } - if (message.code !== 0) { - writer.uint32(32).uint32(message.code); - } - if (message.data !== "") { - writer.uint32(42).string(message.data); - } - if (message.raw_log !== "") { - writer.uint32(50).string(message.raw_log); - } - for (const v of message.logs) { - ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim(); - } - if (message.info !== "") { - writer.uint32(66).string(message.info); - } - if (message.gas_wanted !== 0) { - writer.uint32(72).int64(message.gas_wanted); - } - if (message.gas_used !== 0) { - writer.uint32(80).int64(message.gas_used); - } - if (message.tx !== undefined) { - Any.encode(message.tx, writer.uint32(90).fork()).ldelim(); - } - if (message.timestamp !== "") { - writer.uint32(98).string(message.timestamp); - } - for (const v of message.events) { - Event.encode(v!, writer.uint32(106).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TxResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxResponse } as TxResponse; - message.logs = []; - message.events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - case 2: - message.txhash = reader.string(); - break; - case 3: - message.codespace = reader.string(); - break; - case 4: - message.code = reader.uint32(); - break; - case 5: - message.data = reader.string(); - break; - case 6: - message.raw_log = reader.string(); - break; - case 7: - message.logs.push(ABCIMessageLog.decode(reader, reader.uint32())); - break; - case 8: - message.info = reader.string(); - break; - case 9: - message.gas_wanted = longToNumber(reader.int64() as Long); - break; - case 10: - message.gas_used = longToNumber(reader.int64() as Long); - break; - case 11: - message.tx = Any.decode(reader, reader.uint32()); - break; - case 12: - message.timestamp = reader.string(); - break; - case 13: - message.events.push(Event.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TxResponse { - const message = { ...baseTxResponse } as TxResponse; - message.logs = []; - message.events = []; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.txhash !== undefined && object.txhash !== null) { - message.txhash = String(object.txhash); - } else { - message.txhash = ""; - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = String(object.codespace); - } else { - message.codespace = ""; - } - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = String(object.data); - } else { - message.data = ""; - } - if (object.raw_log !== undefined && object.raw_log !== null) { - message.raw_log = String(object.raw_log); - } else { - message.raw_log = ""; - } - if (object.logs !== undefined && object.logs !== null) { - for (const e of object.logs) { - message.logs.push(ABCIMessageLog.fromJSON(e)); - } - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = Number(object.gas_wanted); - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = Number(object.gas_used); - } else { - message.gas_used = 0; - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = Any.fromJSON(object.tx); - } else { - message.tx = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = String(object.timestamp); - } else { - message.timestamp = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: TxResponse): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.txhash !== undefined && (obj.txhash = message.txhash); - message.codespace !== undefined && (obj.codespace = message.codespace); - message.code !== undefined && (obj.code = message.code); - message.data !== undefined && (obj.data = message.data); - message.raw_log !== undefined && (obj.raw_log = message.raw_log); - if (message.logs) { - obj.logs = message.logs.map((e) => - e ? ABCIMessageLog.toJSON(e) : undefined - ); - } else { - obj.logs = []; - } - message.info !== undefined && (obj.info = message.info); - message.gas_wanted !== undefined && (obj.gas_wanted = message.gas_wanted); - message.gas_used !== undefined && (obj.gas_used = message.gas_used); - message.tx !== undefined && - (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined); - message.timestamp !== undefined && (obj.timestamp = message.timestamp); - if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); - } else { - obj.events = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): TxResponse { - const message = { ...baseTxResponse } as TxResponse; - message.logs = []; - message.events = []; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.txhash !== undefined && object.txhash !== null) { - message.txhash = object.txhash; - } else { - message.txhash = ""; - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } else { - message.codespace = ""; - } - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = ""; - } - if (object.raw_log !== undefined && object.raw_log !== null) { - message.raw_log = object.raw_log; - } else { - message.raw_log = ""; - } - if (object.logs !== undefined && object.logs !== null) { - for (const e of object.logs) { - message.logs.push(ABCIMessageLog.fromPartial(e)); - } - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = object.gas_wanted; - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = object.gas_used; - } else { - message.gas_used = 0; - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = Any.fromPartial(object.tx); - } else { - message.tx = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } - return message; - }, -}; - -const baseABCIMessageLog: object = { msg_index: 0, log: "" }; - -export const ABCIMessageLog = { - encode(message: ABCIMessageLog, writer: Writer = Writer.create()): Writer { - if (message.msg_index !== 0) { - writer.uint32(8).uint32(message.msg_index); - } - if (message.log !== "") { - writer.uint32(18).string(message.log); - } - for (const v of message.events) { - StringEvent.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ABCIMessageLog { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseABCIMessageLog } as ABCIMessageLog; - message.events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.msg_index = reader.uint32(); - break; - case 2: - message.log = reader.string(); - break; - case 3: - message.events.push(StringEvent.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ABCIMessageLog { - const message = { ...baseABCIMessageLog } as ABCIMessageLog; - message.events = []; - if (object.msg_index !== undefined && object.msg_index !== null) { - message.msg_index = Number(object.msg_index); - } else { - message.msg_index = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(StringEvent.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ABCIMessageLog): unknown { - const obj: any = {}; - message.msg_index !== undefined && (obj.msg_index = message.msg_index); - message.log !== undefined && (obj.log = message.log); - if (message.events) { - obj.events = message.events.map((e) => - e ? StringEvent.toJSON(e) : undefined - ); - } else { - obj.events = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ABCIMessageLog { - const message = { ...baseABCIMessageLog } as ABCIMessageLog; - message.events = []; - if (object.msg_index !== undefined && object.msg_index !== null) { - message.msg_index = object.msg_index; - } else { - message.msg_index = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(StringEvent.fromPartial(e)); - } - } - return message; - }, -}; - -const baseStringEvent: object = { type: "" }; - -export const StringEvent = { - encode(message: StringEvent, writer: Writer = Writer.create()): Writer { - if (message.type !== "") { - writer.uint32(10).string(message.type); - } - for (const v of message.attributes) { - Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): StringEvent { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseStringEvent } as StringEvent; - message.attributes = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): StringEvent { - const message = { ...baseStringEvent } as StringEvent; - message.attributes = []; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.attributes !== undefined && object.attributes !== null) { - for (const e of object.attributes) { - message.attributes.push(Attribute.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: StringEvent): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = message.type); - if (message.attributes) { - obj.attributes = message.attributes.map((e) => - e ? Attribute.toJSON(e) : undefined - ); - } else { - obj.attributes = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): StringEvent { - const message = { ...baseStringEvent } as StringEvent; - message.attributes = []; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.attributes !== undefined && object.attributes !== null) { - for (const e of object.attributes) { - message.attributes.push(Attribute.fromPartial(e)); - } - } - return message; - }, -}; - -const baseAttribute: object = { key: "", value: "" }; - -export const Attribute = { - encode(message: Attribute, writer: Writer = Writer.create()): Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Attribute { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAttribute } as Attribute; - 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 { - const message = { ...baseAttribute } as Attribute; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = String(object.value); - } else { - message.value = ""; - } - return message; - }, - - toJSON(message: Attribute): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; - }, - - fromPartial(object: DeepPartial): Attribute { - const message = { ...baseAttribute } as Attribute; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = ""; - } - return message; - }, -}; - -const baseGasInfo: object = { gas_wanted: 0, gas_used: 0 }; - -export const GasInfo = { - encode(message: GasInfo, writer: Writer = Writer.create()): Writer { - if (message.gas_wanted !== 0) { - writer.uint32(8).uint64(message.gas_wanted); - } - if (message.gas_used !== 0) { - writer.uint32(16).uint64(message.gas_used); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GasInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGasInfo } as GasInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.gas_wanted = longToNumber(reader.uint64() as Long); - break; - case 2: - message.gas_used = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GasInfo { - const message = { ...baseGasInfo } as GasInfo; - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = Number(object.gas_wanted); - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = Number(object.gas_used); - } else { - message.gas_used = 0; - } - return message; - }, - - toJSON(message: GasInfo): unknown { - const obj: any = {}; - message.gas_wanted !== undefined && (obj.gas_wanted = message.gas_wanted); - message.gas_used !== undefined && (obj.gas_used = message.gas_used); - return obj; - }, - - fromPartial(object: DeepPartial): GasInfo { - const message = { ...baseGasInfo } as GasInfo; - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = object.gas_wanted; - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = object.gas_used; - } else { - message.gas_used = 0; - } - return message; - }, -}; - -const baseResult: object = { log: "" }; - -export const Result = { - encode(message: Result, writer: Writer = Writer.create()): Writer { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } - if (message.log !== "") { - writer.uint32(18).string(message.log); - } - for (const v of message.events) { - Event.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Result { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResult } as Result; - message.events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; - case 2: - message.log = reader.string(); - break; - case 3: - message.events.push(Event.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Result { - const message = { ...baseResult } as Result; - message.events = []; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Result): unknown { - const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.log !== undefined && (obj.log = message.log); - if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); - } else { - obj.events = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Result { - const message = { ...baseResult } as Result; - message.events = []; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSimulationResponse: object = {}; - -export const SimulationResponse = { - encode( - message: SimulationResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.gas_info !== undefined) { - GasInfo.encode(message.gas_info, writer.uint32(10).fork()).ldelim(); - } - if (message.result !== undefined) { - Result.encode(message.result, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SimulationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimulationResponse } as SimulationResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.gas_info = GasInfo.decode(reader, reader.uint32()); - break; - case 2: - message.result = Result.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SimulationResponse { - const message = { ...baseSimulationResponse } as SimulationResponse; - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gas_info = GasInfo.fromJSON(object.gas_info); - } else { - message.gas_info = undefined; - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromJSON(object.result); - } else { - message.result = undefined; - } - return message; - }, - - toJSON(message: SimulationResponse): unknown { - const obj: any = {}; - message.gas_info !== undefined && - (obj.gas_info = message.gas_info - ? GasInfo.toJSON(message.gas_info) - : undefined); - message.result !== undefined && - (obj.result = message.result ? Result.toJSON(message.result) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): SimulationResponse { - const message = { ...baseSimulationResponse } as SimulationResponse; - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gas_info = GasInfo.fromPartial(object.gas_info); - } else { - message.gas_info = undefined; - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromPartial(object.result); - } else { - message.result = undefined; - } - return message; - }, -}; - -const baseMsgData: object = { msg_type: "" }; - -export const MsgData = { - encode(message: MsgData, writer: Writer = Writer.create()): Writer { - if (message.msg_type !== "") { - writer.uint32(10).string(message.msg_type); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgData { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgData } as MsgData; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.msg_type = reader.string(); - break; - case 2: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgData { - const message = { ...baseMsgData } as MsgData; - if (object.msg_type !== undefined && object.msg_type !== null) { - message.msg_type = String(object.msg_type); - } else { - message.msg_type = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - toJSON(message: MsgData): unknown { - const obj: any = {}; - message.msg_type !== undefined && (obj.msg_type = message.msg_type); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): MsgData { - const message = { ...baseMsgData } as MsgData; - if (object.msg_type !== undefined && object.msg_type !== null) { - message.msg_type = object.msg_type; - } else { - message.msg_type = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, -}; - -const baseTxMsgData: object = {}; - -export const TxMsgData = { - encode(message: TxMsgData, writer: Writer = Writer.create()): Writer { - for (const v of message.data) { - MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TxMsgData { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxMsgData } as TxMsgData; - message.data = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data.push(MsgData.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TxMsgData { - const message = { ...baseTxMsgData } as TxMsgData; - message.data = []; - if (object.data !== undefined && object.data !== null) { - for (const e of object.data) { - message.data.push(MsgData.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: TxMsgData): unknown { - const obj: any = {}; - if (message.data) { - obj.data = message.data.map((e) => (e ? MsgData.toJSON(e) : undefined)); - } else { - obj.data = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): TxMsgData { - const message = { ...baseTxMsgData } as TxMsgData; - message.data = []; - if (object.data !== undefined && object.data !== null) { - for (const e of object.data) { - message.data.push(MsgData.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSearchTxsResult: object = { - total_count: 0, - count: 0, - page_number: 0, - page_total: 0, - limit: 0, -}; - -export const SearchTxsResult = { - encode(message: SearchTxsResult, writer: Writer = Writer.create()): Writer { - if (message.total_count !== 0) { - writer.uint32(8).uint64(message.total_count); - } - if (message.count !== 0) { - writer.uint32(16).uint64(message.count); - } - if (message.page_number !== 0) { - writer.uint32(24).uint64(message.page_number); - } - if (message.page_total !== 0) { - writer.uint32(32).uint64(message.page_total); - } - if (message.limit !== 0) { - writer.uint32(40).uint64(message.limit); - } - for (const v of message.txs) { - TxResponse.encode(v!, writer.uint32(50).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SearchTxsResult { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSearchTxsResult } as SearchTxsResult; - message.txs = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total_count = longToNumber(reader.uint64() as Long); - break; - case 2: - message.count = longToNumber(reader.uint64() as Long); - break; - case 3: - message.page_number = longToNumber(reader.uint64() as Long); - break; - case 4: - message.page_total = longToNumber(reader.uint64() as Long); - break; - case 5: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 6: - message.txs.push(TxResponse.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SearchTxsResult { - const message = { ...baseSearchTxsResult } as SearchTxsResult; - message.txs = []; - if (object.total_count !== undefined && object.total_count !== null) { - message.total_count = Number(object.total_count); - } else { - message.total_count = 0; - } - if (object.count !== undefined && object.count !== null) { - message.count = Number(object.count); - } else { - message.count = 0; - } - if (object.page_number !== undefined && object.page_number !== null) { - message.page_number = Number(object.page_number); - } else { - message.page_number = 0; - } - if (object.page_total !== undefined && object.page_total !== null) { - message.page_total = Number(object.page_total); - } else { - message.page_total = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(TxResponse.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: SearchTxsResult): unknown { - const obj: any = {}; - message.total_count !== undefined && - (obj.total_count = message.total_count); - message.count !== undefined && (obj.count = message.count); - message.page_number !== undefined && - (obj.page_number = message.page_number); - message.page_total !== undefined && (obj.page_total = message.page_total); - message.limit !== undefined && (obj.limit = message.limit); - if (message.txs) { - obj.txs = message.txs.map((e) => (e ? TxResponse.toJSON(e) : undefined)); - } else { - obj.txs = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): SearchTxsResult { - const message = { ...baseSearchTxsResult } as SearchTxsResult; - message.txs = []; - if (object.total_count !== undefined && object.total_count !== null) { - message.total_count = object.total_count; - } else { - message.total_count = 0; - } - if (object.count !== undefined && object.count !== null) { - message.count = object.count; - } else { - message.count = 0; - } - if (object.page_number !== undefined && object.page_number !== null) { - message.page_number = object.page_number; - } else { - message.page_number = 0; - } - if (object.page_total !== undefined && object.page_total !== null) { - message.page_total = object.page_total; - } else { - message.page_total = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(TxResponse.fromPartial(e)); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 9c87ac0c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ce2ac984..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - 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 { - denom: string; - amount: string; -} - -/** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProto { - int: string; -} - -/** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProto { - dec: string; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - 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 { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - 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): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { - if (message.int !== "") { - writer.uint32(10).string(message.int); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - 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 { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { - if (message.dec !== "") { - writer.uint32(10).string(message.dec); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - 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 { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/crypto/multisig/v1beta1/multisig.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/crypto/multisig/v1beta1/multisig.ts deleted file mode 100644 index f076f4a9..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/crypto/multisig/v1beta1/multisig.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; - -/** - * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. - * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers - * signed and with which modes. - */ -export interface MultiSignature { - signatures: Uint8Array[]; -} - -/** - * CompactBitArray is an implementation of a space efficient bit array. - * This is used to ensure that the encoded data takes up a minimal amount of - * space after proto encoding. - * This is not thread safe, and is not intended for concurrent usage. - */ -export interface CompactBitArray { - extra_bits_stored: number; - elems: Uint8Array; -} - -const baseMultiSignature: object = {}; - -export const MultiSignature = { - encode(message: MultiSignature, writer: Writer = Writer.create()): Writer { - for (const v of message.signatures) { - writer.uint32(10).bytes(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MultiSignature { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMultiSignature } as MultiSignature; - message.signatures = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signatures.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MultiSignature { - const message = { ...baseMultiSignature } as MultiSignature; - message.signatures = []; - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(bytesFromBase64(e)); - } - } - return message; - }, - - toJSON(message: MultiSignature): unknown { - const obj: any = {}; - if (message.signatures) { - obj.signatures = message.signatures.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.signatures = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MultiSignature { - const message = { ...baseMultiSignature } as MultiSignature; - message.signatures = []; - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(e); - } - } - return message; - }, -}; - -const baseCompactBitArray: object = { extra_bits_stored: 0 }; - -export const CompactBitArray = { - encode(message: CompactBitArray, writer: Writer = Writer.create()): Writer { - if (message.extra_bits_stored !== 0) { - writer.uint32(8).uint32(message.extra_bits_stored); - } - if (message.elems.length !== 0) { - writer.uint32(18).bytes(message.elems); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CompactBitArray { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCompactBitArray } as CompactBitArray; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.extra_bits_stored = reader.uint32(); - break; - case 2: - message.elems = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CompactBitArray { - const message = { ...baseCompactBitArray } as CompactBitArray; - if ( - object.extra_bits_stored !== undefined && - object.extra_bits_stored !== null - ) { - message.extra_bits_stored = Number(object.extra_bits_stored); - } else { - message.extra_bits_stored = 0; - } - if (object.elems !== undefined && object.elems !== null) { - message.elems = bytesFromBase64(object.elems); - } - return message; - }, - - toJSON(message: CompactBitArray): unknown { - const obj: any = {}; - message.extra_bits_stored !== undefined && - (obj.extra_bits_stored = message.extra_bits_stored); - message.elems !== undefined && - (obj.elems = base64FromBytes( - message.elems !== undefined ? message.elems : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): CompactBitArray { - const message = { ...baseCompactBitArray } as CompactBitArray; - if ( - object.extra_bits_stored !== undefined && - object.extra_bits_stored !== null - ) { - message.extra_bits_stored = object.extra_bits_stored; - } else { - message.extra_bits_stored = 0; - } - if (object.elems !== undefined && object.elems !== null) { - message.elems = object.elems; - } else { - message.elems = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/tx/signing/v1beta1/signing.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/tx/signing/v1beta1/signing.ts deleted file mode 100644 index 2cbfff8c..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/tx/signing/v1beta1/signing.ts +++ /dev/null @@ -1,642 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { CompactBitArray } from "../../../../cosmos/crypto/multisig/v1beta1/multisig"; - -export const protobufPackage = "cosmos.tx.signing.v1beta1"; - -/** SignMode represents a signing mode with its own security guarantees. */ -export enum SignMode { - /** - * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - * rejected - */ - SIGN_MODE_UNSPECIFIED = 0, - /** - * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - * verified with raw bytes from Tx - */ - SIGN_MODE_DIRECT = 1, - /** - * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some - * human-readable textual representation on top of the binary representation - * from SIGN_MODE_DIRECT - */ - SIGN_MODE_TEXTUAL = 2, - /** - * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - * Amino JSON and will be removed in the future - */ - SIGN_MODE_LEGACY_AMINO_JSON = 127, - UNRECOGNIZED = -1, -} - -export function signModeFromJSON(object: any): SignMode { - switch (object) { - case 0: - case "SIGN_MODE_UNSPECIFIED": - return SignMode.SIGN_MODE_UNSPECIFIED; - case 1: - case "SIGN_MODE_DIRECT": - return SignMode.SIGN_MODE_DIRECT; - case 2: - case "SIGN_MODE_TEXTUAL": - return SignMode.SIGN_MODE_TEXTUAL; - case 127: - case "SIGN_MODE_LEGACY_AMINO_JSON": - return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; - case -1: - case "UNRECOGNIZED": - default: - return SignMode.UNRECOGNIZED; - } -} - -export function signModeToJSON(object: SignMode): string { - switch (object) { - case SignMode.SIGN_MODE_UNSPECIFIED: - return "SIGN_MODE_UNSPECIFIED"; - case SignMode.SIGN_MODE_DIRECT: - return "SIGN_MODE_DIRECT"; - case SignMode.SIGN_MODE_TEXTUAL: - return "SIGN_MODE_TEXTUAL"; - case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: - return "SIGN_MODE_LEGACY_AMINO_JSON"; - default: - return "UNKNOWN"; - } -} - -/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ -export interface SignatureDescriptors { - /** signatures are the signature descriptors */ - signatures: SignatureDescriptor[]; -} - -/** - * SignatureDescriptor is a convenience type which represents the full data for - * a signature including the public key of the signer, signing modes and the - * signature itself. It is primarily used for coordinating signatures between - * clients. - */ -export interface SignatureDescriptor { - /** public_key is the public key of the signer */ - public_key: Any | undefined; - data: SignatureDescriptor_Data | undefined; - /** - * sequence is the sequence of the account, which describes the - * number of committed transactions signed by a given address. It is used to prevent - * replay attacks. - */ - sequence: number; -} - -/** Data represents signature data */ -export interface SignatureDescriptor_Data { - /** single represents a single signer */ - single: SignatureDescriptor_Data_Single | undefined; - /** multi represents a multisig signer */ - multi: SignatureDescriptor_Data_Multi | undefined; -} - -/** Single is the signature data for a single signer */ -export interface SignatureDescriptor_Data_Single { - /** mode is the signing mode of the single signer */ - mode: SignMode; - /** signature is the raw signature bytes */ - signature: Uint8Array; -} - -/** Multi is the signature data for a multisig public key */ -export interface SignatureDescriptor_Data_Multi { - /** bitarray specifies which keys within the multisig are signing */ - bitarray: CompactBitArray | undefined; - /** signatures is the signatures of the multi-signature */ - signatures: SignatureDescriptor_Data[]; -} - -const baseSignatureDescriptors: object = {}; - -export const SignatureDescriptors = { - encode( - message: SignatureDescriptors, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.signatures) { - SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SignatureDescriptors { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignatureDescriptors } as SignatureDescriptors; - message.signatures = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signatures.push( - SignatureDescriptor.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignatureDescriptors { - const message = { ...baseSignatureDescriptors } as SignatureDescriptors; - message.signatures = []; - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(SignatureDescriptor.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: SignatureDescriptors): unknown { - const obj: any = {}; - if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? SignatureDescriptor.toJSON(e) : undefined - ); - } else { - obj.signatures = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): SignatureDescriptors { - const message = { ...baseSignatureDescriptors } as SignatureDescriptors; - message.signatures = []; - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(SignatureDescriptor.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSignatureDescriptor: object = { sequence: 0 }; - -export const SignatureDescriptor = { - encode( - message: SignatureDescriptor, - writer: Writer = Writer.create() - ): Writer { - if (message.public_key !== undefined) { - Any.encode(message.public_key, writer.uint32(10).fork()).ldelim(); - } - if (message.data !== undefined) { - SignatureDescriptor_Data.encode( - message.data, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.sequence !== 0) { - writer.uint32(24).uint64(message.sequence); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignatureDescriptor } as SignatureDescriptor; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.public_key = Any.decode(reader, reader.uint32()); - break; - case 2: - message.data = SignatureDescriptor_Data.decode( - reader, - reader.uint32() - ); - break; - case 3: - message.sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignatureDescriptor { - const message = { ...baseSignatureDescriptor } as SignatureDescriptor; - if (object.public_key !== undefined && object.public_key !== null) { - message.public_key = Any.fromJSON(object.public_key); - } else { - message.public_key = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = SignatureDescriptor_Data.fromJSON(object.data); - } else { - message.data = undefined; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; - }, - - toJSON(message: SignatureDescriptor): unknown { - const obj: any = {}; - message.public_key !== undefined && - (obj.public_key = message.public_key - ? Any.toJSON(message.public_key) - : undefined); - message.data !== undefined && - (obj.data = message.data - ? SignatureDescriptor_Data.toJSON(message.data) - : undefined); - message.sequence !== undefined && (obj.sequence = message.sequence); - return obj; - }, - - fromPartial(object: DeepPartial): SignatureDescriptor { - const message = { ...baseSignatureDescriptor } as SignatureDescriptor; - if (object.public_key !== undefined && object.public_key !== null) { - message.public_key = Any.fromPartial(object.public_key); - } else { - message.public_key = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = SignatureDescriptor_Data.fromPartial(object.data); - } else { - message.data = undefined; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - return message; - }, -}; - -const baseSignatureDescriptor_Data: object = {}; - -export const SignatureDescriptor_Data = { - encode( - message: SignatureDescriptor_Data, - writer: Writer = Writer.create() - ): Writer { - if (message.single !== undefined) { - SignatureDescriptor_Data_Single.encode( - message.single, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.multi !== undefined) { - SignatureDescriptor_Data_Multi.encode( - message.multi, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): SignatureDescriptor_Data { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSignatureDescriptor_Data, - } as SignatureDescriptor_Data; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.single = SignatureDescriptor_Data_Single.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.multi = SignatureDescriptor_Data_Multi.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignatureDescriptor_Data { - const message = { - ...baseSignatureDescriptor_Data, - } as SignatureDescriptor_Data; - if (object.single !== undefined && object.single !== null) { - message.single = SignatureDescriptor_Data_Single.fromJSON(object.single); - } else { - message.single = undefined; - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = SignatureDescriptor_Data_Multi.fromJSON(object.multi); - } else { - message.multi = undefined; - } - return message; - }, - - toJSON(message: SignatureDescriptor_Data): unknown { - const obj: any = {}; - message.single !== undefined && - (obj.single = message.single - ? SignatureDescriptor_Data_Single.toJSON(message.single) - : undefined); - message.multi !== undefined && - (obj.multi = message.multi - ? SignatureDescriptor_Data_Multi.toJSON(message.multi) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): SignatureDescriptor_Data { - const message = { - ...baseSignatureDescriptor_Data, - } as SignatureDescriptor_Data; - if (object.single !== undefined && object.single !== null) { - message.single = SignatureDescriptor_Data_Single.fromPartial( - object.single - ); - } else { - message.single = undefined; - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = SignatureDescriptor_Data_Multi.fromPartial(object.multi); - } else { - message.multi = undefined; - } - return message; - }, -}; - -const baseSignatureDescriptor_Data_Single: object = { mode: 0 }; - -export const SignatureDescriptor_Data_Single = { - encode( - message: SignatureDescriptor_Data_Single, - writer: Writer = Writer.create() - ): Writer { - if (message.mode !== 0) { - writer.uint32(8).int32(message.mode); - } - if (message.signature.length !== 0) { - writer.uint32(18).bytes(message.signature); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): SignatureDescriptor_Data_Single { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSignatureDescriptor_Data_Single, - } as SignatureDescriptor_Data_Single; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mode = reader.int32() as any; - break; - case 2: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignatureDescriptor_Data_Single { - const message = { - ...baseSignatureDescriptor_Data_Single, - } as SignatureDescriptor_Data_Single; - if (object.mode !== undefined && object.mode !== null) { - message.mode = signModeFromJSON(object.mode); - } else { - message.mode = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: SignatureDescriptor_Data_Single): unknown { - const obj: any = {}; - message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): SignatureDescriptor_Data_Single { - const message = { - ...baseSignatureDescriptor_Data_Single, - } as SignatureDescriptor_Data_Single; - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } else { - message.mode = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseSignatureDescriptor_Data_Multi: object = {}; - -export const SignatureDescriptor_Data_Multi = { - encode( - message: SignatureDescriptor_Data_Multi, - writer: Writer = Writer.create() - ): Writer { - if (message.bitarray !== undefined) { - CompactBitArray.encode( - message.bitarray, - writer.uint32(10).fork() - ).ldelim(); - } - for (const v of message.signatures) { - SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): SignatureDescriptor_Data_Multi { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSignatureDescriptor_Data_Multi, - } as SignatureDescriptor_Data_Multi; - message.signatures = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.bitarray = CompactBitArray.decode(reader, reader.uint32()); - break; - case 2: - message.signatures.push( - SignatureDescriptor_Data.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignatureDescriptor_Data_Multi { - const message = { - ...baseSignatureDescriptor_Data_Multi, - } as SignatureDescriptor_Data_Multi; - message.signatures = []; - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromJSON(object.bitarray); - } else { - message.bitarray = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(SignatureDescriptor_Data.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: SignatureDescriptor_Data_Multi): unknown { - const obj: any = {}; - message.bitarray !== undefined && - (obj.bitarray = message.bitarray - ? CompactBitArray.toJSON(message.bitarray) - : undefined); - if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? SignatureDescriptor_Data.toJSON(e) : undefined - ); - } else { - obj.signatures = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SignatureDescriptor_Data_Multi { - const message = { - ...baseSignatureDescriptor_Data_Multi, - } as SignatureDescriptor_Data_Multi; - message.signatures = []; - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromPartial(object.bitarray); - } else { - message.bitarray = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(SignatureDescriptor_Data.fromPartial(e)); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/tx/v1beta1/service.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/tx/v1beta1/service.ts deleted file mode 100644 index 5a9e8b0b..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/tx/v1beta1/service.ts +++ /dev/null @@ -1,952 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; -import { Tx } from "../../../cosmos/tx/v1beta1/tx"; -import { - TxResponse, - GasInfo, - Result, -} from "../../../cosmos/base/abci/v1beta1/abci"; - -export const protobufPackage = "cosmos.tx.v1beta1"; - -/** OrderBy defines the sorting order */ -export enum OrderBy { - /** ORDER_BY_UNSPECIFIED - ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. */ - ORDER_BY_UNSPECIFIED = 0, - /** ORDER_BY_ASC - ORDER_BY_ASC defines ascending order */ - ORDER_BY_ASC = 1, - /** ORDER_BY_DESC - ORDER_BY_DESC defines descending order */ - ORDER_BY_DESC = 2, - UNRECOGNIZED = -1, -} - -export function orderByFromJSON(object: any): OrderBy { - switch (object) { - case 0: - case "ORDER_BY_UNSPECIFIED": - return OrderBy.ORDER_BY_UNSPECIFIED; - case 1: - case "ORDER_BY_ASC": - return OrderBy.ORDER_BY_ASC; - case 2: - case "ORDER_BY_DESC": - return OrderBy.ORDER_BY_DESC; - case -1: - case "UNRECOGNIZED": - default: - return OrderBy.UNRECOGNIZED; - } -} - -export function orderByToJSON(object: OrderBy): string { - switch (object) { - case OrderBy.ORDER_BY_UNSPECIFIED: - return "ORDER_BY_UNSPECIFIED"; - case OrderBy.ORDER_BY_ASC: - return "ORDER_BY_ASC"; - case OrderBy.ORDER_BY_DESC: - return "ORDER_BY_DESC"; - default: - return "UNKNOWN"; - } -} - -/** BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. */ -export enum BroadcastMode { - /** BROADCAST_MODE_UNSPECIFIED - zero-value for mode ordering */ - BROADCAST_MODE_UNSPECIFIED = 0, - /** - * BROADCAST_MODE_BLOCK - BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - * the tx to be committed in a block. - */ - BROADCAST_MODE_BLOCK = 1, - /** - * BROADCAST_MODE_SYNC - BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - * a CheckTx execution response only. - */ - BROADCAST_MODE_SYNC = 2, - /** - * BROADCAST_MODE_ASYNC - BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - * immediately. - */ - BROADCAST_MODE_ASYNC = 3, - UNRECOGNIZED = -1, -} - -export function broadcastModeFromJSON(object: any): BroadcastMode { - switch (object) { - case 0: - case "BROADCAST_MODE_UNSPECIFIED": - return BroadcastMode.BROADCAST_MODE_UNSPECIFIED; - case 1: - case "BROADCAST_MODE_BLOCK": - return BroadcastMode.BROADCAST_MODE_BLOCK; - case 2: - case "BROADCAST_MODE_SYNC": - return BroadcastMode.BROADCAST_MODE_SYNC; - case 3: - case "BROADCAST_MODE_ASYNC": - return BroadcastMode.BROADCAST_MODE_ASYNC; - case -1: - case "UNRECOGNIZED": - default: - return BroadcastMode.UNRECOGNIZED; - } -} - -export function broadcastModeToJSON(object: BroadcastMode): string { - switch (object) { - case BroadcastMode.BROADCAST_MODE_UNSPECIFIED: - return "BROADCAST_MODE_UNSPECIFIED"; - case BroadcastMode.BROADCAST_MODE_BLOCK: - return "BROADCAST_MODE_BLOCK"; - case BroadcastMode.BROADCAST_MODE_SYNC: - return "BROADCAST_MODE_SYNC"; - case BroadcastMode.BROADCAST_MODE_ASYNC: - return "BROADCAST_MODE_ASYNC"; - default: - return "UNKNOWN"; - } -} - -/** - * GetTxsEventRequest is the request type for the Service.TxsByEvents - * RPC method. - */ -export interface GetTxsEventRequest { - /** events is the list of transaction event type. */ - events: string[]; - /** pagination defines an pagination for the request. */ - pagination: PageRequest | undefined; - order_by: OrderBy; -} - -/** - * GetTxsEventResponse is the response type for the Service.TxsByEvents - * RPC method. - */ -export interface GetTxsEventResponse { - /** txs is the list of queried transactions. */ - txs: Tx[]; - /** tx_responses is the list of queried TxResponses. */ - tx_responses: TxResponse[]; - /** pagination defines an pagination for the response. */ - pagination: PageResponse | undefined; -} - -/** - * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest - * RPC method. - */ -export interface BroadcastTxRequest { - /** tx_bytes is the raw transaction. */ - tx_bytes: Uint8Array; - mode: BroadcastMode; -} - -/** - * BroadcastTxResponse is the response type for the - * Service.BroadcastTx method. - */ -export interface BroadcastTxResponse { - /** tx_response is the queried TxResponses. */ - tx_response: TxResponse | undefined; -} - -/** - * SimulateRequest is the request type for the Service.Simulate - * RPC method. - */ -export interface SimulateRequest { - /** - * tx is the transaction to simulate. - * Deprecated. Send raw tx bytes instead. - * - * @deprecated - */ - tx: Tx | undefined; - /** - * tx_bytes is the raw transaction. - * - * Since: cosmos-sdk 0.43 - */ - tx_bytes: Uint8Array; -} - -/** - * SimulateResponse is the response type for the - * Service.SimulateRPC method. - */ -export interface SimulateResponse { - /** gas_info is the information about gas used in the simulation. */ - gas_info: GasInfo | undefined; - /** result is the result of the simulation. */ - result: Result | undefined; -} - -/** - * GetTxRequest is the request type for the Service.GetTx - * RPC method. - */ -export interface GetTxRequest { - /** hash is the tx hash to query, encoded as a hex string. */ - hash: string; -} - -/** GetTxResponse is the response type for the Service.GetTx method. */ -export interface GetTxResponse { - /** tx is the queried transaction. */ - tx: Tx | undefined; - /** tx_response is the queried TxResponses. */ - tx_response: TxResponse | undefined; -} - -const baseGetTxsEventRequest: object = { events: "", order_by: 0 }; - -export const GetTxsEventRequest = { - encode( - message: GetTxsEventRequest, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.events) { - writer.uint32(10).string(v!); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - if (message.order_by !== 0) { - writer.uint32(24).int32(message.order_by); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetTxsEventRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetTxsEventRequest } as GetTxsEventRequest; - message.events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.events.push(reader.string()); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - case 3: - message.order_by = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetTxsEventRequest { - const message = { ...baseGetTxsEventRequest } as GetTxsEventRequest; - message.events = []; - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(String(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - if (object.order_by !== undefined && object.order_by !== null) { - message.order_by = orderByFromJSON(object.order_by); - } else { - message.order_by = 0; - } - return message; - }, - - toJSON(message: GetTxsEventRequest): unknown { - const obj: any = {}; - if (message.events) { - obj.events = message.events.map((e) => e); - } else { - obj.events = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - message.order_by !== undefined && - (obj.order_by = orderByToJSON(message.order_by)); - return obj; - }, - - fromPartial(object: DeepPartial): GetTxsEventRequest { - const message = { ...baseGetTxsEventRequest } as GetTxsEventRequest; - message.events = []; - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(e); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - if (object.order_by !== undefined && object.order_by !== null) { - message.order_by = object.order_by; - } else { - message.order_by = 0; - } - return message; - }, -}; - -const baseGetTxsEventResponse: object = {}; - -export const GetTxsEventResponse = { - encode( - message: GetTxsEventResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.txs) { - Tx.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.tx_responses) { - TxResponse.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetTxsEventResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetTxsEventResponse } as GetTxsEventResponse; - message.txs = []; - message.tx_responses = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.txs.push(Tx.decode(reader, reader.uint32())); - break; - case 2: - message.tx_responses.push(TxResponse.decode(reader, reader.uint32())); - break; - case 3: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetTxsEventResponse { - const message = { ...baseGetTxsEventResponse } as GetTxsEventResponse; - message.txs = []; - message.tx_responses = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(Tx.fromJSON(e)); - } - } - if (object.tx_responses !== undefined && object.tx_responses !== null) { - for (const e of object.tx_responses) { - message.tx_responses.push(TxResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: GetTxsEventResponse): unknown { - const obj: any = {}; - if (message.txs) { - obj.txs = message.txs.map((e) => (e ? Tx.toJSON(e) : undefined)); - } else { - obj.txs = []; - } - if (message.tx_responses) { - obj.tx_responses = message.tx_responses.map((e) => - e ? TxResponse.toJSON(e) : undefined - ); - } else { - obj.tx_responses = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GetTxsEventResponse { - const message = { ...baseGetTxsEventResponse } as GetTxsEventResponse; - message.txs = []; - message.tx_responses = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(Tx.fromPartial(e)); - } - } - if (object.tx_responses !== undefined && object.tx_responses !== null) { - for (const e of object.tx_responses) { - message.tx_responses.push(TxResponse.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseBroadcastTxRequest: object = { mode: 0 }; - -export const BroadcastTxRequest = { - encode( - message: BroadcastTxRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.tx_bytes.length !== 0) { - writer.uint32(10).bytes(message.tx_bytes); - } - if (message.mode !== 0) { - writer.uint32(16).int32(message.mode); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BroadcastTxRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBroadcastTxRequest } as BroadcastTxRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx_bytes = reader.bytes(); - break; - case 2: - message.mode = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BroadcastTxRequest { - const message = { ...baseBroadcastTxRequest } as BroadcastTxRequest; - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.tx_bytes = bytesFromBase64(object.tx_bytes); - } - if (object.mode !== undefined && object.mode !== null) { - message.mode = broadcastModeFromJSON(object.mode); - } else { - message.mode = 0; - } - return message; - }, - - toJSON(message: BroadcastTxRequest): unknown { - const obj: any = {}; - message.tx_bytes !== undefined && - (obj.tx_bytes = base64FromBytes( - message.tx_bytes !== undefined ? message.tx_bytes : new Uint8Array() - )); - message.mode !== undefined && - (obj.mode = broadcastModeToJSON(message.mode)); - return obj; - }, - - fromPartial(object: DeepPartial): BroadcastTxRequest { - const message = { ...baseBroadcastTxRequest } as BroadcastTxRequest; - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.tx_bytes = object.tx_bytes; - } else { - message.tx_bytes = new Uint8Array(); - } - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } else { - message.mode = 0; - } - return message; - }, -}; - -const baseBroadcastTxResponse: object = {}; - -export const BroadcastTxResponse = { - encode( - message: BroadcastTxResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.tx_response !== undefined) { - TxResponse.encode(message.tx_response, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BroadcastTxResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBroadcastTxResponse } as BroadcastTxResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx_response = TxResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BroadcastTxResponse { - const message = { ...baseBroadcastTxResponse } as BroadcastTxResponse; - if (object.tx_response !== undefined && object.tx_response !== null) { - message.tx_response = TxResponse.fromJSON(object.tx_response); - } else { - message.tx_response = undefined; - } - return message; - }, - - toJSON(message: BroadcastTxResponse): unknown { - const obj: any = {}; - message.tx_response !== undefined && - (obj.tx_response = message.tx_response - ? TxResponse.toJSON(message.tx_response) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): BroadcastTxResponse { - const message = { ...baseBroadcastTxResponse } as BroadcastTxResponse; - if (object.tx_response !== undefined && object.tx_response !== null) { - message.tx_response = TxResponse.fromPartial(object.tx_response); - } else { - message.tx_response = undefined; - } - return message; - }, -}; - -const baseSimulateRequest: object = {}; - -export const SimulateRequest = { - encode(message: SimulateRequest, writer: Writer = Writer.create()): Writer { - if (message.tx !== undefined) { - Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); - } - if (message.tx_bytes.length !== 0) { - writer.uint32(18).bytes(message.tx_bytes); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SimulateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimulateRequest } as SimulateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx = Tx.decode(reader, reader.uint32()); - break; - case 2: - message.tx_bytes = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SimulateRequest { - const message = { ...baseSimulateRequest } as SimulateRequest; - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromJSON(object.tx); - } else { - message.tx = undefined; - } - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.tx_bytes = bytesFromBase64(object.tx_bytes); - } - return message; - }, - - toJSON(message: SimulateRequest): unknown { - const obj: any = {}; - message.tx !== undefined && - (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); - message.tx_bytes !== undefined && - (obj.tx_bytes = base64FromBytes( - message.tx_bytes !== undefined ? message.tx_bytes : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): SimulateRequest { - const message = { ...baseSimulateRequest } as SimulateRequest; - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromPartial(object.tx); - } else { - message.tx = undefined; - } - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.tx_bytes = object.tx_bytes; - } else { - message.tx_bytes = new Uint8Array(); - } - return message; - }, -}; - -const baseSimulateResponse: object = {}; - -export const SimulateResponse = { - encode(message: SimulateResponse, writer: Writer = Writer.create()): Writer { - if (message.gas_info !== undefined) { - GasInfo.encode(message.gas_info, writer.uint32(10).fork()).ldelim(); - } - if (message.result !== undefined) { - Result.encode(message.result, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SimulateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimulateResponse } as SimulateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.gas_info = GasInfo.decode(reader, reader.uint32()); - break; - case 2: - message.result = Result.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SimulateResponse { - const message = { ...baseSimulateResponse } as SimulateResponse; - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gas_info = GasInfo.fromJSON(object.gas_info); - } else { - message.gas_info = undefined; - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromJSON(object.result); - } else { - message.result = undefined; - } - return message; - }, - - toJSON(message: SimulateResponse): unknown { - const obj: any = {}; - message.gas_info !== undefined && - (obj.gas_info = message.gas_info - ? GasInfo.toJSON(message.gas_info) - : undefined); - message.result !== undefined && - (obj.result = message.result ? Result.toJSON(message.result) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): SimulateResponse { - const message = { ...baseSimulateResponse } as SimulateResponse; - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gas_info = GasInfo.fromPartial(object.gas_info); - } else { - message.gas_info = undefined; - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromPartial(object.result); - } else { - message.result = undefined; - } - return message; - }, -}; - -const baseGetTxRequest: object = { hash: "" }; - -export const GetTxRequest = { - encode(message: GetTxRequest, writer: Writer = Writer.create()): Writer { - if (message.hash !== "") { - writer.uint32(10).string(message.hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetTxRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetTxRequest } as GetTxRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetTxRequest { - const message = { ...baseGetTxRequest } as GetTxRequest; - if (object.hash !== undefined && object.hash !== null) { - message.hash = String(object.hash); - } else { - message.hash = ""; - } - return message; - }, - - toJSON(message: GetTxRequest): unknown { - const obj: any = {}; - message.hash !== undefined && (obj.hash = message.hash); - return obj; - }, - - fromPartial(object: DeepPartial): GetTxRequest { - const message = { ...baseGetTxRequest } as GetTxRequest; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = ""; - } - return message; - }, -}; - -const baseGetTxResponse: object = {}; - -export const GetTxResponse = { - encode(message: GetTxResponse, writer: Writer = Writer.create()): Writer { - if (message.tx !== undefined) { - Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); - } - if (message.tx_response !== undefined) { - TxResponse.encode(message.tx_response, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GetTxResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetTxResponse } as GetTxResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx = Tx.decode(reader, reader.uint32()); - break; - case 2: - message.tx_response = TxResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GetTxResponse { - const message = { ...baseGetTxResponse } as GetTxResponse; - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromJSON(object.tx); - } else { - message.tx = undefined; - } - if (object.tx_response !== undefined && object.tx_response !== null) { - message.tx_response = TxResponse.fromJSON(object.tx_response); - } else { - message.tx_response = undefined; - } - return message; - }, - - toJSON(message: GetTxResponse): unknown { - const obj: any = {}; - message.tx !== undefined && - (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); - message.tx_response !== undefined && - (obj.tx_response = message.tx_response - ? TxResponse.toJSON(message.tx_response) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GetTxResponse { - const message = { ...baseGetTxResponse } as GetTxResponse; - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromPartial(object.tx); - } else { - message.tx = undefined; - } - if (object.tx_response !== undefined && object.tx_response !== null) { - message.tx_response = TxResponse.fromPartial(object.tx_response); - } else { - message.tx_response = undefined; - } - return message; - }, -}; - -/** Service defines a gRPC service for interacting with transactions. */ -export interface Service { - /** Simulate simulates executing a transaction for estimating gas usage. */ - Simulate(request: SimulateRequest): Promise; - /** GetTx fetches a tx by hash. */ - GetTx(request: GetTxRequest): Promise; - /** BroadcastTx broadcast transaction. */ - BroadcastTx(request: BroadcastTxRequest): Promise; - /** GetTxsEvent fetches txs by event. */ - GetTxsEvent(request: GetTxsEventRequest): Promise; -} - -export class ServiceClientImpl implements Service { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Simulate(request: SimulateRequest): Promise { - const data = SimulateRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.tx.v1beta1.Service", - "Simulate", - data - ); - return promise.then((data) => SimulateResponse.decode(new Reader(data))); - } - - GetTx(request: GetTxRequest): Promise { - const data = GetTxRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.tx.v1beta1.Service", - "GetTx", - data - ); - return promise.then((data) => GetTxResponse.decode(new Reader(data))); - } - - BroadcastTx(request: BroadcastTxRequest): Promise { - const data = BroadcastTxRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.tx.v1beta1.Service", - "BroadcastTx", - data - ); - return promise.then((data) => BroadcastTxResponse.decode(new Reader(data))); - } - - GetTxsEvent(request: GetTxsEventRequest): Promise { - const data = GetTxsEventRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.tx.v1beta1.Service", - "GetTxsEvent", - data - ); - return promise.then((data) => GetTxsEventResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/tx/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/tx/v1beta1/tx.ts deleted file mode 100644 index 90aba55a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/cosmos/tx/v1beta1/tx.ts +++ /dev/null @@ -1,1274 +0,0 @@ -/* eslint-disable */ -import { - SignMode, - signModeFromJSON, - signModeToJSON, -} from "../../../cosmos/tx/signing/v1beta1/signing"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { CompactBitArray } from "../../../cosmos/crypto/multisig/v1beta1/multisig"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmos.tx.v1beta1"; - -/** Tx is the standard type used for broadcasting transactions. */ -export interface Tx { - /** body is the processable content of the transaction */ - body: TxBody | undefined; - /** - * auth_info is the authorization related content of the transaction, - * specifically signers, signer modes and fee - */ - auth_info: AuthInfo | undefined; - /** - * signatures is a list of signatures that matches the length and order of - * AuthInfo's signer_infos to allow connecting signature meta information like - * public key and signing mode by position. - */ - signatures: Uint8Array[]; -} - -/** - * TxRaw is a variant of Tx that pins the signer's exact binary representation - * of body and auth_info. This is used for signing, broadcasting and - * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and - * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used - * as the transaction ID. - */ -export interface TxRaw { - /** - * body_bytes is a protobuf serialization of a TxBody that matches the - * representation in SignDoc. - */ - body_bytes: Uint8Array; - /** - * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - * representation in SignDoc. - */ - auth_info_bytes: Uint8Array; - /** - * signatures is a list of signatures that matches the length and order of - * AuthInfo's signer_infos to allow connecting signature meta information like - * public key and signing mode by position. - */ - signatures: Uint8Array[]; -} - -/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ -export interface SignDoc { - /** - * body_bytes is protobuf serialization of a TxBody that matches the - * representation in TxRaw. - */ - body_bytes: Uint8Array; - /** - * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - * representation in TxRaw. - */ - auth_info_bytes: Uint8Array; - /** - * chain_id is the unique identifier of the chain this transaction targets. - * It prevents signed transactions from being used on another chain by an - * attacker - */ - chain_id: string; - /** account_number is the account number of the account in state */ - account_number: number; -} - -/** TxBody is the body of a transaction that all signers sign over. */ -export interface TxBody { - /** - * messages is a list of messages to be executed. The required signers of - * those messages define the number and order of elements in AuthInfo's - * signer_infos and Tx's signatures. Each required signer address is added to - * the list only the first time it occurs. - * By convention, the first required signer (usually from the first message) - * is referred to as the primary signer and pays the fee for the whole - * transaction. - */ - messages: Any[]; - /** - * memo is any arbitrary note/comment to be added to the transaction. - * WARNING: in clients, any publicly exposed text should not be called memo, - * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). - */ - memo: string; - /** - * timeout is the block height after which this transaction will not - * be processed by the chain - */ - timeout_height: number; - /** - * extension_options are arbitrary options that can be added by chains - * when the default options are not sufficient. If any of these are present - * and can't be handled, the transaction will be rejected - */ - extension_options: Any[]; - /** - * extension_options are arbitrary options that can be added by chains - * when the default options are not sufficient. If any of these are present - * and can't be handled, they will be ignored - */ - non_critical_extension_options: Any[]; -} - -/** - * AuthInfo describes the fee and signer modes that are used to sign a - * transaction. - */ -export interface AuthInfo { - /** - * signer_infos defines the signing modes for the required signers. The number - * and order of elements must match the required signers from TxBody's - * messages. The first element is the primary signer and the one which pays - * the fee. - */ - signer_infos: SignerInfo[]; - /** - * Fee is the fee and gas limit for the transaction. The first signer is the - * primary signer and the one which pays the fee. The fee can be calculated - * based on the cost of evaluating the body and doing signature verification - * of the signers. This can be estimated via simulation. - */ - fee: Fee | undefined; -} - -/** - * SignerInfo describes the public key and signing mode of a single top-level - * signer. - */ -export interface SignerInfo { - /** - * public_key is the public key of the signer. It is optional for accounts - * that already exist in state. If unset, the verifier can use the required \ - * signer address for this position and lookup the public key. - */ - public_key: Any | undefined; - /** - * mode_info describes the signing mode of the signer and is a nested - * structure to support nested multisig pubkey's - */ - mode_info: ModeInfo | undefined; - /** - * sequence is the sequence of the account, which describes the - * number of committed transactions signed by a given address. It is used to - * prevent replay attacks. - */ - sequence: number; -} - -/** ModeInfo describes the signing mode of a single or nested multisig signer. */ -export interface ModeInfo { - /** single represents a single signer */ - single: ModeInfo_Single | undefined; - /** multi represents a nested multisig signer */ - multi: ModeInfo_Multi | undefined; -} - -/** - * Single is the mode info for a single signer. It is structured as a message - * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the - * future - */ -export interface ModeInfo_Single { - /** mode is the signing mode of the single signer */ - mode: SignMode; -} - -/** Multi is the mode info for a multisig public key */ -export interface ModeInfo_Multi { - /** bitarray specifies which keys within the multisig are signing */ - bitarray: CompactBitArray | undefined; - /** - * mode_infos is the corresponding modes of the signers of the multisig - * which could include nested multisig public keys - */ - mode_infos: ModeInfo[]; -} - -/** - * Fee includes the amount of coins paid in fees and the maximum - * gas to be used by the transaction. The ratio yields an effective "gasprice", - * which must be above some miminum to be accepted into the mempool. - */ -export interface Fee { - /** amount is the amount of coins to be paid as a fee */ - amount: Coin[]; - /** - * gas_limit is the maximum gas that can be used in transaction processing - * before an out of gas error occurs - */ - gas_limit: number; - /** - * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - * the payer must be a tx signer (and thus have signed this field in AuthInfo). - * setting this field does *not* change the ordering of required signers for the transaction. - */ - payer: string; - /** - * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - * not support fee grants, this will fail - */ - granter: string; -} - -const baseTx: object = {}; - -export const Tx = { - encode(message: Tx, writer: Writer = Writer.create()): Writer { - if (message.body !== undefined) { - TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); - } - if (message.auth_info !== undefined) { - AuthInfo.encode(message.auth_info, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.signatures) { - writer.uint32(26).bytes(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Tx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTx } as Tx; - message.signatures = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.body = TxBody.decode(reader, reader.uint32()); - break; - case 2: - message.auth_info = AuthInfo.decode(reader, reader.uint32()); - break; - case 3: - message.signatures.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Tx { - const message = { ...baseTx } as Tx; - message.signatures = []; - if (object.body !== undefined && object.body !== null) { - message.body = TxBody.fromJSON(object.body); - } else { - message.body = undefined; - } - if (object.auth_info !== undefined && object.auth_info !== null) { - message.auth_info = AuthInfo.fromJSON(object.auth_info); - } else { - message.auth_info = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(bytesFromBase64(e)); - } - } - return message; - }, - - toJSON(message: Tx): unknown { - const obj: any = {}; - message.body !== undefined && - (obj.body = message.body ? TxBody.toJSON(message.body) : undefined); - message.auth_info !== undefined && - (obj.auth_info = message.auth_info - ? AuthInfo.toJSON(message.auth_info) - : undefined); - if (message.signatures) { - obj.signatures = message.signatures.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.signatures = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Tx { - const message = { ...baseTx } as Tx; - message.signatures = []; - if (object.body !== undefined && object.body !== null) { - message.body = TxBody.fromPartial(object.body); - } else { - message.body = undefined; - } - if (object.auth_info !== undefined && object.auth_info !== null) { - message.auth_info = AuthInfo.fromPartial(object.auth_info); - } else { - message.auth_info = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(e); - } - } - return message; - }, -}; - -const baseTxRaw: object = {}; - -export const TxRaw = { - encode(message: TxRaw, writer: Writer = Writer.create()): Writer { - if (message.body_bytes.length !== 0) { - writer.uint32(10).bytes(message.body_bytes); - } - if (message.auth_info_bytes.length !== 0) { - writer.uint32(18).bytes(message.auth_info_bytes); - } - for (const v of message.signatures) { - writer.uint32(26).bytes(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TxRaw { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxRaw } as TxRaw; - message.signatures = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.body_bytes = reader.bytes(); - break; - case 2: - message.auth_info_bytes = reader.bytes(); - break; - case 3: - message.signatures.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TxRaw { - const message = { ...baseTxRaw } as TxRaw; - message.signatures = []; - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.body_bytes = bytesFromBase64(object.body_bytes); - } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.auth_info_bytes = bytesFromBase64(object.auth_info_bytes); - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(bytesFromBase64(e)); - } - } - return message; - }, - - toJSON(message: TxRaw): unknown { - const obj: any = {}; - message.body_bytes !== undefined && - (obj.body_bytes = base64FromBytes( - message.body_bytes !== undefined ? message.body_bytes : new Uint8Array() - )); - message.auth_info_bytes !== undefined && - (obj.auth_info_bytes = base64FromBytes( - message.auth_info_bytes !== undefined - ? message.auth_info_bytes - : new Uint8Array() - )); - if (message.signatures) { - obj.signatures = message.signatures.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.signatures = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): TxRaw { - const message = { ...baseTxRaw } as TxRaw; - message.signatures = []; - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.body_bytes = object.body_bytes; - } else { - message.body_bytes = new Uint8Array(); - } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.auth_info_bytes = object.auth_info_bytes; - } else { - message.auth_info_bytes = new Uint8Array(); - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(e); - } - } - return message; - }, -}; - -const baseSignDoc: object = { chain_id: "", account_number: 0 }; - -export const SignDoc = { - encode(message: SignDoc, writer: Writer = Writer.create()): Writer { - if (message.body_bytes.length !== 0) { - writer.uint32(10).bytes(message.body_bytes); - } - if (message.auth_info_bytes.length !== 0) { - writer.uint32(18).bytes(message.auth_info_bytes); - } - if (message.chain_id !== "") { - writer.uint32(26).string(message.chain_id); - } - if (message.account_number !== 0) { - writer.uint32(32).uint64(message.account_number); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SignDoc { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignDoc } as SignDoc; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.body_bytes = reader.bytes(); - break; - case 2: - message.auth_info_bytes = reader.bytes(); - break; - case 3: - message.chain_id = reader.string(); - break; - case 4: - message.account_number = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignDoc { - const message = { ...baseSignDoc } as SignDoc; - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.body_bytes = bytesFromBase64(object.body_bytes); - } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.auth_info_bytes = bytesFromBase64(object.auth_info_bytes); - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = Number(object.account_number); - } else { - message.account_number = 0; - } - return message; - }, - - toJSON(message: SignDoc): unknown { - const obj: any = {}; - message.body_bytes !== undefined && - (obj.body_bytes = base64FromBytes( - message.body_bytes !== undefined ? message.body_bytes : new Uint8Array() - )); - message.auth_info_bytes !== undefined && - (obj.auth_info_bytes = base64FromBytes( - message.auth_info_bytes !== undefined - ? message.auth_info_bytes - : new Uint8Array() - )); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.account_number !== undefined && - (obj.account_number = message.account_number); - return obj; - }, - - fromPartial(object: DeepPartial): SignDoc { - const message = { ...baseSignDoc } as SignDoc; - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.body_bytes = object.body_bytes; - } else { - message.body_bytes = new Uint8Array(); - } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.auth_info_bytes = object.auth_info_bytes; - } else { - message.auth_info_bytes = new Uint8Array(); - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = object.account_number; - } else { - message.account_number = 0; - } - return message; - }, -}; - -const baseTxBody: object = { memo: "", timeout_height: 0 }; - -export const TxBody = { - encode(message: TxBody, writer: Writer = Writer.create()): Writer { - for (const v of message.messages) { - Any.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.memo !== "") { - writer.uint32(18).string(message.memo); - } - if (message.timeout_height !== 0) { - writer.uint32(24).uint64(message.timeout_height); - } - for (const v of message.extension_options) { - Any.encode(v!, writer.uint32(8186).fork()).ldelim(); - } - for (const v of message.non_critical_extension_options) { - Any.encode(v!, writer.uint32(16378).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TxBody { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxBody } as TxBody; - message.messages = []; - message.extension_options = []; - message.non_critical_extension_options = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messages.push(Any.decode(reader, reader.uint32())); - break; - case 2: - message.memo = reader.string(); - break; - case 3: - message.timeout_height = longToNumber(reader.uint64() as Long); - break; - case 1023: - message.extension_options.push(Any.decode(reader, reader.uint32())); - break; - case 2047: - message.non_critical_extension_options.push( - Any.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TxBody { - const message = { ...baseTxBody } as TxBody; - message.messages = []; - message.extension_options = []; - message.non_critical_extension_options = []; - if (object.messages !== undefined && object.messages !== null) { - for (const e of object.messages) { - message.messages.push(Any.fromJSON(e)); - } - } - if (object.memo !== undefined && object.memo !== null) { - message.memo = String(object.memo); - } else { - message.memo = ""; - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = Number(object.timeout_height); - } else { - message.timeout_height = 0; - } - if ( - object.extension_options !== undefined && - object.extension_options !== null - ) { - for (const e of object.extension_options) { - message.extension_options.push(Any.fromJSON(e)); - } - } - if ( - object.non_critical_extension_options !== undefined && - object.non_critical_extension_options !== null - ) { - for (const e of object.non_critical_extension_options) { - message.non_critical_extension_options.push(Any.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: TxBody): unknown { - const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map((e) => - e ? Any.toJSON(e) : undefined - ); - } else { - obj.messages = []; - } - message.memo !== undefined && (obj.memo = message.memo); - message.timeout_height !== undefined && - (obj.timeout_height = message.timeout_height); - if (message.extension_options) { - obj.extension_options = message.extension_options.map((e) => - e ? Any.toJSON(e) : undefined - ); - } else { - obj.extension_options = []; - } - if (message.non_critical_extension_options) { - obj.non_critical_extension_options = message.non_critical_extension_options.map( - (e) => (e ? Any.toJSON(e) : undefined) - ); - } else { - obj.non_critical_extension_options = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): TxBody { - const message = { ...baseTxBody } as TxBody; - message.messages = []; - message.extension_options = []; - message.non_critical_extension_options = []; - if (object.messages !== undefined && object.messages !== null) { - for (const e of object.messages) { - message.messages.push(Any.fromPartial(e)); - } - } - if (object.memo !== undefined && object.memo !== null) { - message.memo = object.memo; - } else { - message.memo = ""; - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = object.timeout_height; - } else { - message.timeout_height = 0; - } - if ( - object.extension_options !== undefined && - object.extension_options !== null - ) { - for (const e of object.extension_options) { - message.extension_options.push(Any.fromPartial(e)); - } - } - if ( - object.non_critical_extension_options !== undefined && - object.non_critical_extension_options !== null - ) { - for (const e of object.non_critical_extension_options) { - message.non_critical_extension_options.push(Any.fromPartial(e)); - } - } - return message; - }, -}; - -const baseAuthInfo: object = {}; - -export const AuthInfo = { - encode(message: AuthInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.signer_infos) { - SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fee !== undefined) { - Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): AuthInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAuthInfo } as AuthInfo; - message.signer_infos = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer_infos.push(SignerInfo.decode(reader, reader.uint32())); - break; - case 2: - message.fee = Fee.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AuthInfo { - const message = { ...baseAuthInfo } as AuthInfo; - message.signer_infos = []; - if (object.signer_infos !== undefined && object.signer_infos !== null) { - for (const e of object.signer_infos) { - message.signer_infos.push(SignerInfo.fromJSON(e)); - } - } - if (object.fee !== undefined && object.fee !== null) { - message.fee = Fee.fromJSON(object.fee); - } else { - message.fee = undefined; - } - return message; - }, - - toJSON(message: AuthInfo): unknown { - const obj: any = {}; - if (message.signer_infos) { - obj.signer_infos = message.signer_infos.map((e) => - e ? SignerInfo.toJSON(e) : undefined - ); - } else { - obj.signer_infos = []; - } - message.fee !== undefined && - (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): AuthInfo { - const message = { ...baseAuthInfo } as AuthInfo; - message.signer_infos = []; - if (object.signer_infos !== undefined && object.signer_infos !== null) { - for (const e of object.signer_infos) { - message.signer_infos.push(SignerInfo.fromPartial(e)); - } - } - if (object.fee !== undefined && object.fee !== null) { - message.fee = Fee.fromPartial(object.fee); - } else { - message.fee = undefined; - } - return message; - }, -}; - -const baseSignerInfo: object = { sequence: 0 }; - -export const SignerInfo = { - encode(message: SignerInfo, writer: Writer = Writer.create()): Writer { - if (message.public_key !== undefined) { - Any.encode(message.public_key, writer.uint32(10).fork()).ldelim(); - } - if (message.mode_info !== undefined) { - ModeInfo.encode(message.mode_info, writer.uint32(18).fork()).ldelim(); - } - if (message.sequence !== 0) { - writer.uint32(24).uint64(message.sequence); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SignerInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignerInfo } as SignerInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.public_key = Any.decode(reader, reader.uint32()); - break; - case 2: - message.mode_info = ModeInfo.decode(reader, reader.uint32()); - break; - case 3: - message.sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignerInfo { - const message = { ...baseSignerInfo } as SignerInfo; - if (object.public_key !== undefined && object.public_key !== null) { - message.public_key = Any.fromJSON(object.public_key); - } else { - message.public_key = undefined; - } - if (object.mode_info !== undefined && object.mode_info !== null) { - message.mode_info = ModeInfo.fromJSON(object.mode_info); - } else { - message.mode_info = undefined; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; - }, - - toJSON(message: SignerInfo): unknown { - const obj: any = {}; - message.public_key !== undefined && - (obj.public_key = message.public_key - ? Any.toJSON(message.public_key) - : undefined); - message.mode_info !== undefined && - (obj.mode_info = message.mode_info - ? ModeInfo.toJSON(message.mode_info) - : undefined); - message.sequence !== undefined && (obj.sequence = message.sequence); - return obj; - }, - - fromPartial(object: DeepPartial): SignerInfo { - const message = { ...baseSignerInfo } as SignerInfo; - if (object.public_key !== undefined && object.public_key !== null) { - message.public_key = Any.fromPartial(object.public_key); - } else { - message.public_key = undefined; - } - if (object.mode_info !== undefined && object.mode_info !== null) { - message.mode_info = ModeInfo.fromPartial(object.mode_info); - } else { - message.mode_info = undefined; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - return message; - }, -}; - -const baseModeInfo: object = {}; - -export const ModeInfo = { - encode(message: ModeInfo, writer: Writer = Writer.create()): Writer { - if (message.single !== undefined) { - ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); - } - if (message.multi !== undefined) { - ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ModeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModeInfo } as ModeInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.single = ModeInfo_Single.decode(reader, reader.uint32()); - break; - case 2: - message.multi = ModeInfo_Multi.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ModeInfo { - const message = { ...baseModeInfo } as ModeInfo; - if (object.single !== undefined && object.single !== null) { - message.single = ModeInfo_Single.fromJSON(object.single); - } else { - message.single = undefined; - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = ModeInfo_Multi.fromJSON(object.multi); - } else { - message.multi = undefined; - } - return message; - }, - - toJSON(message: ModeInfo): unknown { - const obj: any = {}; - message.single !== undefined && - (obj.single = message.single - ? ModeInfo_Single.toJSON(message.single) - : undefined); - message.multi !== undefined && - (obj.multi = message.multi - ? ModeInfo_Multi.toJSON(message.multi) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): ModeInfo { - const message = { ...baseModeInfo } as ModeInfo; - if (object.single !== undefined && object.single !== null) { - message.single = ModeInfo_Single.fromPartial(object.single); - } else { - message.single = undefined; - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = ModeInfo_Multi.fromPartial(object.multi); - } else { - message.multi = undefined; - } - return message; - }, -}; - -const baseModeInfo_Single: object = { mode: 0 }; - -export const ModeInfo_Single = { - encode(message: ModeInfo_Single, writer: Writer = Writer.create()): Writer { - if (message.mode !== 0) { - writer.uint32(8).int32(message.mode); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ModeInfo_Single { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModeInfo_Single } as ModeInfo_Single; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mode = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ModeInfo_Single { - const message = { ...baseModeInfo_Single } as ModeInfo_Single; - if (object.mode !== undefined && object.mode !== null) { - message.mode = signModeFromJSON(object.mode); - } else { - message.mode = 0; - } - return message; - }, - - toJSON(message: ModeInfo_Single): unknown { - const obj: any = {}; - message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); - return obj; - }, - - fromPartial(object: DeepPartial): ModeInfo_Single { - const message = { ...baseModeInfo_Single } as ModeInfo_Single; - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } else { - message.mode = 0; - } - return message; - }, -}; - -const baseModeInfo_Multi: object = {}; - -export const ModeInfo_Multi = { - encode(message: ModeInfo_Multi, writer: Writer = Writer.create()): Writer { - if (message.bitarray !== undefined) { - CompactBitArray.encode( - message.bitarray, - writer.uint32(10).fork() - ).ldelim(); - } - for (const v of message.mode_infos) { - ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ModeInfo_Multi { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; - message.mode_infos = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.bitarray = CompactBitArray.decode(reader, reader.uint32()); - break; - case 2: - message.mode_infos.push(ModeInfo.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ModeInfo_Multi { - const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; - message.mode_infos = []; - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromJSON(object.bitarray); - } else { - message.bitarray = undefined; - } - if (object.mode_infos !== undefined && object.mode_infos !== null) { - for (const e of object.mode_infos) { - message.mode_infos.push(ModeInfo.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ModeInfo_Multi): unknown { - const obj: any = {}; - message.bitarray !== undefined && - (obj.bitarray = message.bitarray - ? CompactBitArray.toJSON(message.bitarray) - : undefined); - if (message.mode_infos) { - obj.mode_infos = message.mode_infos.map((e) => - e ? ModeInfo.toJSON(e) : undefined - ); - } else { - obj.mode_infos = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ModeInfo_Multi { - const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; - message.mode_infos = []; - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromPartial(object.bitarray); - } else { - message.bitarray = undefined; - } - if (object.mode_infos !== undefined && object.mode_infos !== null) { - for (const e of object.mode_infos) { - message.mode_infos.push(ModeInfo.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFee: object = { gas_limit: 0, payer: "", granter: "" }; - -export const Fee = { - encode(message: Fee, writer: Writer = Writer.create()): Writer { - for (const v of message.amount) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.gas_limit !== 0) { - writer.uint32(16).uint64(message.gas_limit); - } - if (message.payer !== "") { - writer.uint32(26).string(message.payer); - } - if (message.granter !== "") { - writer.uint32(34).string(message.granter); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Fee { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFee } as Fee; - message.amount = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; - case 2: - message.gas_limit = longToNumber(reader.uint64() as Long); - break; - case 3: - message.payer = reader.string(); - break; - case 4: - message.granter = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Fee { - const message = { ...baseFee } as Fee; - message.amount = []; - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - if (object.gas_limit !== undefined && object.gas_limit !== null) { - message.gas_limit = Number(object.gas_limit); - } else { - message.gas_limit = 0; - } - if (object.payer !== undefined && object.payer !== null) { - message.payer = String(object.payer); - } else { - message.payer = ""; - } - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - return message; - }, - - toJSON(message: Fee): unknown { - const obj: any = {}; - if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.amount = []; - } - message.gas_limit !== undefined && (obj.gas_limit = message.gas_limit); - message.payer !== undefined && (obj.payer = message.payer); - message.granter !== undefined && (obj.granter = message.granter); - return obj; - }, - - fromPartial(object: DeepPartial): Fee { - const message = { ...baseFee } as Fee; - message.amount = []; - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } - if (object.gas_limit !== undefined && object.gas_limit !== null) { - message.gas_limit = object.gas_limit; - } else { - message.gas_limit = 0; - } - if (object.payer !== undefined && object.payer !== null) { - message.payer = object.payer; - } else { - message.payer = ""; - } - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/duration.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/duration.ts deleted file mode 100644 index fffd5b14..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/duration.ts +++ /dev/null @@ -1,188 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - */ -export interface Duration { - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ - seconds: number; - /** - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - */ - nanos: number; -} - -const baseDuration: object = { seconds: 0, nanos: 0 }; - -export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDuration } as Duration; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Duration): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/abci/types.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/abci/types.ts deleted file mode 100644 index c765beea..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/abci/types.ts +++ /dev/null @@ -1,5656 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { Header } from "../../tendermint/types/types"; -import { ProofOps } from "../../tendermint/crypto/proof"; -import { - EvidenceParams, - ValidatorParams, - VersionParams, -} from "../../tendermint/types/params"; -import { PublicKey } from "../../tendermint/crypto/keys"; - -export const protobufPackage = "tendermint.abci"; - -export enum CheckTxType { - NEW = 0, - RECHECK = 1, - UNRECOGNIZED = -1, -} - -export function checkTxTypeFromJSON(object: any): CheckTxType { - switch (object) { - case 0: - case "NEW": - return CheckTxType.NEW; - case 1: - case "RECHECK": - return CheckTxType.RECHECK; - case -1: - case "UNRECOGNIZED": - default: - return CheckTxType.UNRECOGNIZED; - } -} - -export function checkTxTypeToJSON(object: CheckTxType): string { - switch (object) { - case CheckTxType.NEW: - return "NEW"; - case CheckTxType.RECHECK: - return "RECHECK"; - default: - return "UNKNOWN"; - } -} - -export enum EvidenceType { - UNKNOWN = 0, - DUPLICATE_VOTE = 1, - LIGHT_CLIENT_ATTACK = 2, - UNRECOGNIZED = -1, -} - -export function evidenceTypeFromJSON(object: any): EvidenceType { - switch (object) { - case 0: - case "UNKNOWN": - return EvidenceType.UNKNOWN; - case 1: - case "DUPLICATE_VOTE": - return EvidenceType.DUPLICATE_VOTE; - case 2: - case "LIGHT_CLIENT_ATTACK": - return EvidenceType.LIGHT_CLIENT_ATTACK; - case -1: - case "UNRECOGNIZED": - default: - return EvidenceType.UNRECOGNIZED; - } -} - -export function evidenceTypeToJSON(object: EvidenceType): string { - switch (object) { - case EvidenceType.UNKNOWN: - return "UNKNOWN"; - case EvidenceType.DUPLICATE_VOTE: - return "DUPLICATE_VOTE"; - case EvidenceType.LIGHT_CLIENT_ATTACK: - return "LIGHT_CLIENT_ATTACK"; - default: - return "UNKNOWN"; - } -} - -export interface Request { - echo: RequestEcho | undefined; - flush: RequestFlush | undefined; - info: RequestInfo | undefined; - set_option: RequestSetOption | undefined; - init_chain: RequestInitChain | undefined; - query: RequestQuery | undefined; - begin_block: RequestBeginBlock | undefined; - check_tx: RequestCheckTx | undefined; - deliver_tx: RequestDeliverTx | undefined; - end_block: RequestEndBlock | undefined; - commit: RequestCommit | undefined; - list_snapshots: RequestListSnapshots | undefined; - offer_snapshot: RequestOfferSnapshot | undefined; - load_snapshot_chunk: RequestLoadSnapshotChunk | undefined; - apply_snapshot_chunk: RequestApplySnapshotChunk | undefined; -} - -export interface RequestEcho { - message: string; -} - -export interface RequestFlush {} - -export interface RequestInfo { - version: string; - block_version: number; - p2p_version: number; -} - -/** nondeterministic */ -export interface RequestSetOption { - key: string; - value: string; -} - -export interface RequestInitChain { - time: Date | undefined; - chain_id: string; - consensus_params: ConsensusParams | undefined; - validators: ValidatorUpdate[]; - app_state_bytes: Uint8Array; - initial_height: number; -} - -export interface RequestQuery { - data: Uint8Array; - path: string; - height: number; - prove: boolean; -} - -export interface RequestBeginBlock { - hash: Uint8Array; - header: Header | undefined; - last_commit_info: LastCommitInfo | undefined; - byzantine_validators: Evidence[]; -} - -export interface RequestCheckTx { - tx: Uint8Array; - type: CheckTxType; -} - -export interface RequestDeliverTx { - tx: Uint8Array; -} - -export interface RequestEndBlock { - height: number; -} - -export interface RequestCommit {} - -/** lists available snapshots */ -export interface RequestListSnapshots {} - -/** offers a snapshot to the application */ -export interface RequestOfferSnapshot { - /** snapshot offered by peers */ - snapshot: Snapshot | undefined; - /** light client-verified app hash for snapshot height */ - app_hash: Uint8Array; -} - -/** loads a snapshot chunk */ -export interface RequestLoadSnapshotChunk { - height: number; - format: number; - chunk: number; -} - -/** Applies a snapshot chunk */ -export interface RequestApplySnapshotChunk { - index: number; - chunk: Uint8Array; - sender: string; -} - -export interface Response { - exception: ResponseException | undefined; - echo: ResponseEcho | undefined; - flush: ResponseFlush | undefined; - info: ResponseInfo | undefined; - set_option: ResponseSetOption | undefined; - init_chain: ResponseInitChain | undefined; - query: ResponseQuery | undefined; - begin_block: ResponseBeginBlock | undefined; - check_tx: ResponseCheckTx | undefined; - deliver_tx: ResponseDeliverTx | undefined; - end_block: ResponseEndBlock | undefined; - commit: ResponseCommit | undefined; - list_snapshots: ResponseListSnapshots | undefined; - offer_snapshot: ResponseOfferSnapshot | undefined; - load_snapshot_chunk: ResponseLoadSnapshotChunk | undefined; - apply_snapshot_chunk: ResponseApplySnapshotChunk | undefined; -} - -/** nondeterministic */ -export interface ResponseException { - error: string; -} - -export interface ResponseEcho { - message: string; -} - -export interface ResponseFlush {} - -export interface ResponseInfo { - data: string; - version: string; - app_version: number; - last_block_height: number; - last_block_app_hash: Uint8Array; -} - -/** nondeterministic */ -export interface ResponseSetOption { - code: number; - /** bytes data = 2; */ - log: string; - info: string; -} - -export interface ResponseInitChain { - consensus_params: ConsensusParams | undefined; - validators: ValidatorUpdate[]; - app_hash: Uint8Array; -} - -export interface ResponseQuery { - code: number; - /** bytes data = 2; // use "value" instead. */ - log: string; - /** nondeterministic */ - info: string; - index: number; - key: Uint8Array; - value: Uint8Array; - proof_ops: ProofOps | undefined; - height: number; - codespace: string; -} - -export interface ResponseBeginBlock { - events: Event[]; -} - -export interface ResponseCheckTx { - code: number; - data: Uint8Array; - /** nondeterministic */ - log: string; - /** nondeterministic */ - info: string; - gas_wanted: number; - gas_used: number; - events: Event[]; - codespace: string; -} - -export interface ResponseDeliverTx { - code: number; - data: Uint8Array; - /** nondeterministic */ - log: string; - /** nondeterministic */ - info: string; - gas_wanted: number; - gas_used: number; - events: Event[]; - codespace: string; -} - -export interface ResponseEndBlock { - validator_updates: ValidatorUpdate[]; - consensus_param_updates: ConsensusParams | undefined; - events: Event[]; -} - -export interface ResponseCommit { - /** reserve 1 */ - data: Uint8Array; - retain_height: number; -} - -export interface ResponseListSnapshots { - snapshots: Snapshot[]; -} - -export interface ResponseOfferSnapshot { - result: ResponseOfferSnapshot_Result; -} - -export enum ResponseOfferSnapshot_Result { - /** UNKNOWN - Unknown result, abort all snapshot restoration */ - UNKNOWN = 0, - /** ACCEPT - Snapshot accepted, apply chunks */ - ACCEPT = 1, - /** ABORT - Abort all snapshot restoration */ - ABORT = 2, - /** REJECT - Reject this specific snapshot, try others */ - REJECT = 3, - /** REJECT_FORMAT - Reject all snapshots of this format, try others */ - REJECT_FORMAT = 4, - /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */ - REJECT_SENDER = 5, - UNRECOGNIZED = -1, -} - -export function responseOfferSnapshot_ResultFromJSON( - object: any -): ResponseOfferSnapshot_Result { - switch (object) { - case 0: - case "UNKNOWN": - return ResponseOfferSnapshot_Result.UNKNOWN; - case 1: - case "ACCEPT": - return ResponseOfferSnapshot_Result.ACCEPT; - case 2: - case "ABORT": - return ResponseOfferSnapshot_Result.ABORT; - case 3: - case "REJECT": - return ResponseOfferSnapshot_Result.REJECT; - case 4: - case "REJECT_FORMAT": - return ResponseOfferSnapshot_Result.REJECT_FORMAT; - case 5: - case "REJECT_SENDER": - return ResponseOfferSnapshot_Result.REJECT_SENDER; - case -1: - case "UNRECOGNIZED": - default: - return ResponseOfferSnapshot_Result.UNRECOGNIZED; - } -} - -export function responseOfferSnapshot_ResultToJSON( - object: ResponseOfferSnapshot_Result -): string { - switch (object) { - case ResponseOfferSnapshot_Result.UNKNOWN: - return "UNKNOWN"; - case ResponseOfferSnapshot_Result.ACCEPT: - return "ACCEPT"; - case ResponseOfferSnapshot_Result.ABORT: - return "ABORT"; - case ResponseOfferSnapshot_Result.REJECT: - return "REJECT"; - case ResponseOfferSnapshot_Result.REJECT_FORMAT: - return "REJECT_FORMAT"; - case ResponseOfferSnapshot_Result.REJECT_SENDER: - return "REJECT_SENDER"; - default: - return "UNKNOWN"; - } -} - -export interface ResponseLoadSnapshotChunk { - chunk: Uint8Array; -} - -export interface ResponseApplySnapshotChunk { - result: ResponseApplySnapshotChunk_Result; - /** Chunks to refetch and reapply */ - refetch_chunks: number[]; - /** Chunk senders to reject and ban */ - reject_senders: string[]; -} - -export enum ResponseApplySnapshotChunk_Result { - /** UNKNOWN - Unknown result, abort all snapshot restoration */ - UNKNOWN = 0, - /** ACCEPT - Chunk successfully accepted */ - ACCEPT = 1, - /** ABORT - Abort all snapshot restoration */ - ABORT = 2, - /** RETRY - Retry chunk (combine with refetch and reject) */ - RETRY = 3, - /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */ - RETRY_SNAPSHOT = 4, - /** REJECT_SNAPSHOT - Reject this snapshot, try others */ - REJECT_SNAPSHOT = 5, - UNRECOGNIZED = -1, -} - -export function responseApplySnapshotChunk_ResultFromJSON( - object: any -): ResponseApplySnapshotChunk_Result { - switch (object) { - case 0: - case "UNKNOWN": - return ResponseApplySnapshotChunk_Result.UNKNOWN; - case 1: - case "ACCEPT": - return ResponseApplySnapshotChunk_Result.ACCEPT; - case 2: - case "ABORT": - return ResponseApplySnapshotChunk_Result.ABORT; - case 3: - case "RETRY": - return ResponseApplySnapshotChunk_Result.RETRY; - case 4: - case "RETRY_SNAPSHOT": - return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT; - case 5: - case "REJECT_SNAPSHOT": - return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT; - case -1: - case "UNRECOGNIZED": - default: - return ResponseApplySnapshotChunk_Result.UNRECOGNIZED; - } -} - -export function responseApplySnapshotChunk_ResultToJSON( - object: ResponseApplySnapshotChunk_Result -): string { - switch (object) { - case ResponseApplySnapshotChunk_Result.UNKNOWN: - return "UNKNOWN"; - case ResponseApplySnapshotChunk_Result.ACCEPT: - return "ACCEPT"; - case ResponseApplySnapshotChunk_Result.ABORT: - return "ABORT"; - case ResponseApplySnapshotChunk_Result.RETRY: - return "RETRY"; - case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: - return "RETRY_SNAPSHOT"; - case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: - return "REJECT_SNAPSHOT"; - default: - return "UNKNOWN"; - } -} - -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParams { - block: BlockParams | undefined; - evidence: EvidenceParams | undefined; - validator: ValidatorParams | undefined; - version: VersionParams | undefined; -} - -/** BlockParams contains limits on the block size. */ -export interface BlockParams { - /** Note: must be greater than 0 */ - max_bytes: number; - /** Note: must be greater or equal to -1 */ - max_gas: number; -} - -export interface LastCommitInfo { - round: number; - votes: VoteInfo[]; -} - -/** - * Event allows application developers to attach additional information to - * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. - * Later, transactions may be queried using these events. - */ -export interface Event { - type: string; - attributes: EventAttribute[]; -} - -/** EventAttribute is a single key-value pair, associated with an event. */ -export interface EventAttribute { - key: Uint8Array; - value: Uint8Array; - /** nondeterministic */ - index: boolean; -} - -/** - * TxResult contains results of executing the transaction. - * - * One usage is indexing transaction results. - */ -export interface TxResult { - height: number; - index: number; - tx: Uint8Array; - result: ResponseDeliverTx | undefined; -} - -/** Validator */ -export interface Validator { - /** The first 20 bytes of SHA256(public key) */ - address: Uint8Array; - /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ - power: number; -} - -/** ValidatorUpdate */ -export interface ValidatorUpdate { - pub_key: PublicKey | undefined; - power: number; -} - -/** VoteInfo */ -export interface VoteInfo { - validator: Validator | undefined; - signed_last_block: boolean; -} - -export interface Evidence { - type: EvidenceType; - /** The offending validator */ - validator: Validator | undefined; - /** The height when the offense occurred */ - height: number; - /** The corresponding time where the offense occurred */ - time: Date | undefined; - /** - * Total voting power of the validator set in case the ABCI application does - * not store historical validators. - * https://github.com/tendermint/tendermint/issues/4581 - */ - total_voting_power: number; -} - -export interface Snapshot { - /** The height at which the snapshot was taken */ - height: number; - /** The application-specific snapshot format */ - format: number; - /** Number of chunks in the snapshot */ - chunks: number; - /** Arbitrary snapshot hash, equal only if identical */ - hash: Uint8Array; - /** Arbitrary application metadata */ - metadata: Uint8Array; -} - -const baseRequest: object = {}; - -export const Request = { - encode(message: Request, writer: Writer = Writer.create()): Writer { - if (message.echo !== undefined) { - RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); - } - if (message.flush !== undefined) { - RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); - } - if (message.info !== undefined) { - RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); - } - if (message.set_option !== undefined) { - RequestSetOption.encode( - message.set_option, - writer.uint32(34).fork() - ).ldelim(); - } - if (message.init_chain !== undefined) { - RequestInitChain.encode( - message.init_chain, - writer.uint32(42).fork() - ).ldelim(); - } - if (message.query !== undefined) { - RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); - } - if (message.begin_block !== undefined) { - RequestBeginBlock.encode( - message.begin_block, - writer.uint32(58).fork() - ).ldelim(); - } - if (message.check_tx !== undefined) { - RequestCheckTx.encode( - message.check_tx, - writer.uint32(66).fork() - ).ldelim(); - } - if (message.deliver_tx !== undefined) { - RequestDeliverTx.encode( - message.deliver_tx, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.end_block !== undefined) { - RequestEndBlock.encode( - message.end_block, - writer.uint32(82).fork() - ).ldelim(); - } - if (message.commit !== undefined) { - RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); - } - if (message.list_snapshots !== undefined) { - RequestListSnapshots.encode( - message.list_snapshots, - writer.uint32(98).fork() - ).ldelim(); - } - if (message.offer_snapshot !== undefined) { - RequestOfferSnapshot.encode( - message.offer_snapshot, - writer.uint32(106).fork() - ).ldelim(); - } - if (message.load_snapshot_chunk !== undefined) { - RequestLoadSnapshotChunk.encode( - message.load_snapshot_chunk, - writer.uint32(114).fork() - ).ldelim(); - } - if (message.apply_snapshot_chunk !== undefined) { - RequestApplySnapshotChunk.encode( - message.apply_snapshot_chunk, - writer.uint32(122).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Request { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequest } as Request; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.echo = RequestEcho.decode(reader, reader.uint32()); - break; - case 2: - message.flush = RequestFlush.decode(reader, reader.uint32()); - break; - case 3: - message.info = RequestInfo.decode(reader, reader.uint32()); - break; - case 4: - message.set_option = RequestSetOption.decode(reader, reader.uint32()); - break; - case 5: - message.init_chain = RequestInitChain.decode(reader, reader.uint32()); - break; - case 6: - message.query = RequestQuery.decode(reader, reader.uint32()); - break; - case 7: - message.begin_block = RequestBeginBlock.decode( - reader, - reader.uint32() - ); - break; - case 8: - message.check_tx = RequestCheckTx.decode(reader, reader.uint32()); - break; - case 9: - message.deliver_tx = RequestDeliverTx.decode(reader, reader.uint32()); - break; - case 10: - message.end_block = RequestEndBlock.decode(reader, reader.uint32()); - break; - case 11: - message.commit = RequestCommit.decode(reader, reader.uint32()); - break; - case 12: - message.list_snapshots = RequestListSnapshots.decode( - reader, - reader.uint32() - ); - break; - case 13: - message.offer_snapshot = RequestOfferSnapshot.decode( - reader, - reader.uint32() - ); - break; - case 14: - message.load_snapshot_chunk = RequestLoadSnapshotChunk.decode( - reader, - reader.uint32() - ); - break; - case 15: - message.apply_snapshot_chunk = RequestApplySnapshotChunk.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Request { - const message = { ...baseRequest } as Request; - if (object.echo !== undefined && object.echo !== null) { - message.echo = RequestEcho.fromJSON(object.echo); - } else { - message.echo = undefined; - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = RequestFlush.fromJSON(object.flush); - } else { - message.flush = undefined; - } - if (object.info !== undefined && object.info !== null) { - message.info = RequestInfo.fromJSON(object.info); - } else { - message.info = undefined; - } - if (object.set_option !== undefined && object.set_option !== null) { - message.set_option = RequestSetOption.fromJSON(object.set_option); - } else { - message.set_option = undefined; - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.init_chain = RequestInitChain.fromJSON(object.init_chain); - } else { - message.init_chain = undefined; - } - if (object.query !== undefined && object.query !== null) { - message.query = RequestQuery.fromJSON(object.query); - } else { - message.query = undefined; - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.begin_block = RequestBeginBlock.fromJSON(object.begin_block); - } else { - message.begin_block = undefined; - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.check_tx = RequestCheckTx.fromJSON(object.check_tx); - } else { - message.check_tx = undefined; - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliver_tx = RequestDeliverTx.fromJSON(object.deliver_tx); - } else { - message.deliver_tx = undefined; - } - if (object.end_block !== undefined && object.end_block !== null) { - message.end_block = RequestEndBlock.fromJSON(object.end_block); - } else { - message.end_block = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = RequestCommit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.list_snapshots = RequestListSnapshots.fromJSON( - object.list_snapshots - ); - } else { - message.list_snapshots = undefined; - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offer_snapshot = RequestOfferSnapshot.fromJSON( - object.offer_snapshot - ); - } else { - message.offer_snapshot = undefined; - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.load_snapshot_chunk = RequestLoadSnapshotChunk.fromJSON( - object.load_snapshot_chunk - ); - } else { - message.load_snapshot_chunk = undefined; - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.apply_snapshot_chunk = RequestApplySnapshotChunk.fromJSON( - object.apply_snapshot_chunk - ); - } else { - message.apply_snapshot_chunk = undefined; - } - return message; - }, - - toJSON(message: Request): unknown { - const obj: any = {}; - message.echo !== undefined && - (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined); - message.flush !== undefined && - (obj.flush = message.flush - ? RequestFlush.toJSON(message.flush) - : undefined); - message.info !== undefined && - (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined); - message.set_option !== undefined && - (obj.set_option = message.set_option - ? RequestSetOption.toJSON(message.set_option) - : undefined); - message.init_chain !== undefined && - (obj.init_chain = message.init_chain - ? RequestInitChain.toJSON(message.init_chain) - : undefined); - message.query !== undefined && - (obj.query = message.query - ? RequestQuery.toJSON(message.query) - : undefined); - message.begin_block !== undefined && - (obj.begin_block = message.begin_block - ? RequestBeginBlock.toJSON(message.begin_block) - : undefined); - message.check_tx !== undefined && - (obj.check_tx = message.check_tx - ? RequestCheckTx.toJSON(message.check_tx) - : undefined); - message.deliver_tx !== undefined && - (obj.deliver_tx = message.deliver_tx - ? RequestDeliverTx.toJSON(message.deliver_tx) - : undefined); - message.end_block !== undefined && - (obj.end_block = message.end_block - ? RequestEndBlock.toJSON(message.end_block) - : undefined); - message.commit !== undefined && - (obj.commit = message.commit - ? RequestCommit.toJSON(message.commit) - : undefined); - message.list_snapshots !== undefined && - (obj.list_snapshots = message.list_snapshots - ? RequestListSnapshots.toJSON(message.list_snapshots) - : undefined); - message.offer_snapshot !== undefined && - (obj.offer_snapshot = message.offer_snapshot - ? RequestOfferSnapshot.toJSON(message.offer_snapshot) - : undefined); - message.load_snapshot_chunk !== undefined && - (obj.load_snapshot_chunk = message.load_snapshot_chunk - ? RequestLoadSnapshotChunk.toJSON(message.load_snapshot_chunk) - : undefined); - message.apply_snapshot_chunk !== undefined && - (obj.apply_snapshot_chunk = message.apply_snapshot_chunk - ? RequestApplySnapshotChunk.toJSON(message.apply_snapshot_chunk) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Request { - const message = { ...baseRequest } as Request; - if (object.echo !== undefined && object.echo !== null) { - message.echo = RequestEcho.fromPartial(object.echo); - } else { - message.echo = undefined; - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = RequestFlush.fromPartial(object.flush); - } else { - message.flush = undefined; - } - if (object.info !== undefined && object.info !== null) { - message.info = RequestInfo.fromPartial(object.info); - } else { - message.info = undefined; - } - if (object.set_option !== undefined && object.set_option !== null) { - message.set_option = RequestSetOption.fromPartial(object.set_option); - } else { - message.set_option = undefined; - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.init_chain = RequestInitChain.fromPartial(object.init_chain); - } else { - message.init_chain = undefined; - } - if (object.query !== undefined && object.query !== null) { - message.query = RequestQuery.fromPartial(object.query); - } else { - message.query = undefined; - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.begin_block = RequestBeginBlock.fromPartial(object.begin_block); - } else { - message.begin_block = undefined; - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.check_tx = RequestCheckTx.fromPartial(object.check_tx); - } else { - message.check_tx = undefined; - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliver_tx = RequestDeliverTx.fromPartial(object.deliver_tx); - } else { - message.deliver_tx = undefined; - } - if (object.end_block !== undefined && object.end_block !== null) { - message.end_block = RequestEndBlock.fromPartial(object.end_block); - } else { - message.end_block = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = RequestCommit.fromPartial(object.commit); - } else { - message.commit = undefined; - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.list_snapshots = RequestListSnapshots.fromPartial( - object.list_snapshots - ); - } else { - message.list_snapshots = undefined; - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offer_snapshot = RequestOfferSnapshot.fromPartial( - object.offer_snapshot - ); - } else { - message.offer_snapshot = undefined; - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.load_snapshot_chunk = RequestLoadSnapshotChunk.fromPartial( - object.load_snapshot_chunk - ); - } else { - message.load_snapshot_chunk = undefined; - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.apply_snapshot_chunk = RequestApplySnapshotChunk.fromPartial( - object.apply_snapshot_chunk - ); - } else { - message.apply_snapshot_chunk = undefined; - } - return message; - }, -}; - -const baseRequestEcho: object = { message: "" }; - -export const RequestEcho = { - encode(message: RequestEcho, writer: Writer = Writer.create()): Writer { - if (message.message !== "") { - writer.uint32(10).string(message.message); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestEcho { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestEcho } as RequestEcho; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestEcho { - const message = { ...baseRequestEcho } as RequestEcho; - if (object.message !== undefined && object.message !== null) { - message.message = String(object.message); - } else { - message.message = ""; - } - return message; - }, - - toJSON(message: RequestEcho): unknown { - const obj: any = {}; - message.message !== undefined && (obj.message = message.message); - return obj; - }, - - fromPartial(object: DeepPartial): RequestEcho { - const message = { ...baseRequestEcho } as RequestEcho; - if (object.message !== undefined && object.message !== null) { - message.message = object.message; - } else { - message.message = ""; - } - return message; - }, -}; - -const baseRequestFlush: object = {}; - -export const RequestFlush = { - encode(_: RequestFlush, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestFlush { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestFlush } as RequestFlush; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): RequestFlush { - const message = { ...baseRequestFlush } as RequestFlush; - return message; - }, - - toJSON(_: RequestFlush): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): RequestFlush { - const message = { ...baseRequestFlush } as RequestFlush; - return message; - }, -}; - -const baseRequestInfo: object = { - version: "", - block_version: 0, - p2p_version: 0, -}; - -export const RequestInfo = { - encode(message: RequestInfo, writer: Writer = Writer.create()): Writer { - if (message.version !== "") { - writer.uint32(10).string(message.version); - } - if (message.block_version !== 0) { - writer.uint32(16).uint64(message.block_version); - } - if (message.p2p_version !== 0) { - writer.uint32(24).uint64(message.p2p_version); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestInfo } as RequestInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.block_version = longToNumber(reader.uint64() as Long); - break; - case 3: - message.p2p_version = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestInfo { - const message = { ...baseRequestInfo } as RequestInfo; - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.block_version !== undefined && object.block_version !== null) { - message.block_version = Number(object.block_version); - } else { - message.block_version = 0; - } - if (object.p2p_version !== undefined && object.p2p_version !== null) { - message.p2p_version = Number(object.p2p_version); - } else { - message.p2p_version = 0; - } - return message; - }, - - toJSON(message: RequestInfo): unknown { - const obj: any = {}; - message.version !== undefined && (obj.version = message.version); - message.block_version !== undefined && - (obj.block_version = message.block_version); - message.p2p_version !== undefined && - (obj.p2p_version = message.p2p_version); - return obj; - }, - - fromPartial(object: DeepPartial): RequestInfo { - const message = { ...baseRequestInfo } as RequestInfo; - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.block_version !== undefined && object.block_version !== null) { - message.block_version = object.block_version; - } else { - message.block_version = 0; - } - if (object.p2p_version !== undefined && object.p2p_version !== null) { - message.p2p_version = object.p2p_version; - } else { - message.p2p_version = 0; - } - return message; - }, -}; - -const baseRequestSetOption: object = { key: "", value: "" }; - -export const RequestSetOption = { - encode(message: RequestSetOption, writer: Writer = Writer.create()): Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestSetOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestSetOption } as RequestSetOption; - 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): RequestSetOption { - const message = { ...baseRequestSetOption } as RequestSetOption; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = String(object.value); - } else { - message.value = ""; - } - return message; - }, - - toJSON(message: RequestSetOption): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; - }, - - fromPartial(object: DeepPartial): RequestSetOption { - const message = { ...baseRequestSetOption } as RequestSetOption; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = ""; - } - return message; - }, -}; - -const baseRequestInitChain: object = { chain_id: "", initial_height: 0 }; - -export const RequestInitChain = { - encode(message: RequestInitChain, writer: Writer = Writer.create()): Writer { - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(10).fork() - ).ldelim(); - } - if (message.chain_id !== "") { - writer.uint32(18).string(message.chain_id); - } - if (message.consensus_params !== undefined) { - ConsensusParams.encode( - message.consensus_params, - writer.uint32(26).fork() - ).ldelim(); - } - for (const v of message.validators) { - ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); - } - if (message.app_state_bytes.length !== 0) { - writer.uint32(42).bytes(message.app_state_bytes); - } - if (message.initial_height !== 0) { - writer.uint32(48).int64(message.initial_height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestInitChain { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestInitChain } as RequestInitChain; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 2: - message.chain_id = reader.string(); - break; - case 3: - message.consensus_params = ConsensusParams.decode( - reader, - reader.uint32() - ); - break; - case 4: - message.validators.push( - ValidatorUpdate.decode(reader, reader.uint32()) - ); - break; - case 5: - message.app_state_bytes = reader.bytes(); - break; - case 6: - message.initial_height = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestInitChain { - const message = { ...baseRequestInitChain } as RequestInitChain; - message.validators = []; - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensus_params = ConsensusParams.fromJSON( - object.consensus_params - ); - } else { - message.consensus_params = undefined; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(ValidatorUpdate.fromJSON(e)); - } - } - if ( - object.app_state_bytes !== undefined && - object.app_state_bytes !== null - ) { - message.app_state_bytes = bytesFromBase64(object.app_state_bytes); - } - if (object.initial_height !== undefined && object.initial_height !== null) { - message.initial_height = Number(object.initial_height); - } else { - message.initial_height = 0; - } - return message; - }, - - toJSON(message: RequestInitChain): unknown { - const obj: any = {}; - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.consensus_params !== undefined && - (obj.consensus_params = message.consensus_params - ? ConsensusParams.toJSON(message.consensus_params) - : undefined); - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? ValidatorUpdate.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.app_state_bytes !== undefined && - (obj.app_state_bytes = base64FromBytes( - message.app_state_bytes !== undefined - ? message.app_state_bytes - : new Uint8Array() - )); - message.initial_height !== undefined && - (obj.initial_height = message.initial_height); - return obj; - }, - - fromPartial(object: DeepPartial): RequestInitChain { - const message = { ...baseRequestInitChain } as RequestInitChain; - message.validators = []; - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; - } - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensus_params = ConsensusParams.fromPartial( - object.consensus_params - ); - } else { - message.consensus_params = undefined; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(ValidatorUpdate.fromPartial(e)); - } - } - if ( - object.app_state_bytes !== undefined && - object.app_state_bytes !== null - ) { - message.app_state_bytes = object.app_state_bytes; - } else { - message.app_state_bytes = new Uint8Array(); - } - if (object.initial_height !== undefined && object.initial_height !== null) { - message.initial_height = object.initial_height; - } else { - message.initial_height = 0; - } - return message; - }, -}; - -const baseRequestQuery: object = { path: "", height: 0, prove: false }; - -export const RequestQuery = { - encode(message: RequestQuery, writer: Writer = Writer.create()): Writer { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.prove === true) { - writer.uint32(32).bool(message.prove); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestQuery { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestQuery } as RequestQuery; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; - case 2: - message.path = reader.string(); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestQuery { - const message = { ...baseRequestQuery } as RequestQuery; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.prove !== undefined && object.prove !== null) { - message.prove = Boolean(object.prove); - } else { - message.prove = false; - } - return message; - }, - - toJSON(message: RequestQuery): unknown { - const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.path !== undefined && (obj.path = message.path); - message.height !== undefined && (obj.height = message.height); - message.prove !== undefined && (obj.prove = message.prove); - return obj; - }, - - fromPartial(object: DeepPartial): RequestQuery { - const message = { ...baseRequestQuery } as RequestQuery; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.prove !== undefined && object.prove !== null) { - message.prove = object.prove; - } else { - message.prove = false; - } - return message; - }, -}; - -const baseRequestBeginBlock: object = {}; - -export const RequestBeginBlock = { - encode(message: RequestBeginBlock, writer: Writer = Writer.create()): Writer { - if (message.hash.length !== 0) { - writer.uint32(10).bytes(message.hash); - } - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(18).fork()).ldelim(); - } - if (message.last_commit_info !== undefined) { - LastCommitInfo.encode( - message.last_commit_info, - writer.uint32(26).fork() - ).ldelim(); - } - for (const v of message.byzantine_validators) { - Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestBeginBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestBeginBlock } as RequestBeginBlock; - message.byzantine_validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - case 2: - message.header = Header.decode(reader, reader.uint32()); - break; - case 3: - message.last_commit_info = LastCommitInfo.decode( - reader, - reader.uint32() - ); - break; - case 4: - message.byzantine_validators.push( - Evidence.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestBeginBlock { - const message = { ...baseRequestBeginBlock } as RequestBeginBlock; - message.byzantine_validators = []; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if ( - object.last_commit_info !== undefined && - object.last_commit_info !== null - ) { - message.last_commit_info = LastCommitInfo.fromJSON( - object.last_commit_info - ); - } else { - message.last_commit_info = undefined; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Evidence.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: RequestBeginBlock): unknown { - const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.last_commit_info !== undefined && - (obj.last_commit_info = message.last_commit_info - ? LastCommitInfo.toJSON(message.last_commit_info) - : undefined); - if (message.byzantine_validators) { - obj.byzantine_validators = message.byzantine_validators.map((e) => - e ? Evidence.toJSON(e) : undefined - ); - } else { - obj.byzantine_validators = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): RequestBeginBlock { - const message = { ...baseRequestBeginBlock } as RequestBeginBlock; - message.byzantine_validators = []; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if ( - object.last_commit_info !== undefined && - object.last_commit_info !== null - ) { - message.last_commit_info = LastCommitInfo.fromPartial( - object.last_commit_info - ); - } else { - message.last_commit_info = undefined; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Evidence.fromPartial(e)); - } - } - return message; - }, -}; - -const baseRequestCheckTx: object = { type: 0 }; - -export const RequestCheckTx = { - encode(message: RequestCheckTx, writer: Writer = Writer.create()): Writer { - if (message.tx.length !== 0) { - writer.uint32(10).bytes(message.tx); - } - if (message.type !== 0) { - writer.uint32(16).int32(message.type); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestCheckTx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestCheckTx } as RequestCheckTx; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx = reader.bytes(); - break; - case 2: - message.type = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestCheckTx { - const message = { ...baseRequestCheckTx } as RequestCheckTx; - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - if (object.type !== undefined && object.type !== null) { - message.type = checkTxTypeFromJSON(object.type); - } else { - message.type = 0; - } - return message; - }, - - toJSON(message: RequestCheckTx): unknown { - const obj: any = {}; - message.tx !== undefined && - (obj.tx = base64FromBytes( - message.tx !== undefined ? message.tx : new Uint8Array() - )); - message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type)); - return obj; - }, - - fromPartial(object: DeepPartial): RequestCheckTx { - const message = { ...baseRequestCheckTx } as RequestCheckTx; - if (object.tx !== undefined && object.tx !== null) { - message.tx = object.tx; - } else { - message.tx = new Uint8Array(); - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - return message; - }, -}; - -const baseRequestDeliverTx: object = {}; - -export const RequestDeliverTx = { - encode(message: RequestDeliverTx, writer: Writer = Writer.create()): Writer { - if (message.tx.length !== 0) { - writer.uint32(10).bytes(message.tx); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestDeliverTx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestDeliverTx } as RequestDeliverTx; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestDeliverTx { - const message = { ...baseRequestDeliverTx } as RequestDeliverTx; - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - return message; - }, - - toJSON(message: RequestDeliverTx): unknown { - const obj: any = {}; - message.tx !== undefined && - (obj.tx = base64FromBytes( - message.tx !== undefined ? message.tx : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): RequestDeliverTx { - const message = { ...baseRequestDeliverTx } as RequestDeliverTx; - if (object.tx !== undefined && object.tx !== null) { - message.tx = object.tx; - } else { - message.tx = new Uint8Array(); - } - return message; - }, -}; - -const baseRequestEndBlock: object = { height: 0 }; - -export const RequestEndBlock = { - encode(message: RequestEndBlock, writer: Writer = Writer.create()): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestEndBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestEndBlock } as RequestEndBlock; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestEndBlock { - const message = { ...baseRequestEndBlock } as RequestEndBlock; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; - }, - - toJSON(message: RequestEndBlock): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - return obj; - }, - - fromPartial(object: DeepPartial): RequestEndBlock { - const message = { ...baseRequestEndBlock } as RequestEndBlock; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - return message; - }, -}; - -const baseRequestCommit: object = {}; - -export const RequestCommit = { - encode(_: RequestCommit, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestCommit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestCommit } as RequestCommit; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): RequestCommit { - const message = { ...baseRequestCommit } as RequestCommit; - return message; - }, - - toJSON(_: RequestCommit): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): RequestCommit { - const message = { ...baseRequestCommit } as RequestCommit; - return message; - }, -}; - -const baseRequestListSnapshots: object = {}; - -export const RequestListSnapshots = { - encode(_: RequestListSnapshots, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestListSnapshots { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestListSnapshots } as RequestListSnapshots; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): RequestListSnapshots { - const message = { ...baseRequestListSnapshots } as RequestListSnapshots; - return message; - }, - - toJSON(_: RequestListSnapshots): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): RequestListSnapshots { - const message = { ...baseRequestListSnapshots } as RequestListSnapshots; - return message; - }, -}; - -const baseRequestOfferSnapshot: object = {}; - -export const RequestOfferSnapshot = { - encode( - message: RequestOfferSnapshot, - writer: Writer = Writer.create() - ): Writer { - if (message.snapshot !== undefined) { - Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); - } - if (message.app_hash.length !== 0) { - writer.uint32(18).bytes(message.app_hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestOfferSnapshot { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.snapshot = Snapshot.decode(reader, reader.uint32()); - break; - case 2: - message.app_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestOfferSnapshot { - const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; - if (object.snapshot !== undefined && object.snapshot !== null) { - message.snapshot = Snapshot.fromJSON(object.snapshot); - } else { - message.snapshot = undefined; - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - return message; - }, - - toJSON(message: RequestOfferSnapshot): unknown { - const obj: any = {}; - message.snapshot !== undefined && - (obj.snapshot = message.snapshot - ? Snapshot.toJSON(message.snapshot) - : undefined); - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): RequestOfferSnapshot { - const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; - if (object.snapshot !== undefined && object.snapshot !== null) { - message.snapshot = Snapshot.fromPartial(object.snapshot); - } else { - message.snapshot = undefined; - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } - return message; - }, -}; - -const baseRequestLoadSnapshotChunk: object = { height: 0, format: 0, chunk: 0 }; - -export const RequestLoadSnapshotChunk = { - encode( - message: RequestLoadSnapshotChunk, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== 0) { - writer.uint32(8).uint64(message.height); - } - if (message.format !== 0) { - writer.uint32(16).uint32(message.format); - } - if (message.chunk !== 0) { - writer.uint32(24).uint32(message.chunk); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): RequestLoadSnapshotChunk { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseRequestLoadSnapshotChunk, - } as RequestLoadSnapshotChunk; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.uint64() as Long); - break; - case 2: - message.format = reader.uint32(); - break; - case 3: - message.chunk = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestLoadSnapshotChunk { - const message = { - ...baseRequestLoadSnapshotChunk, - } as RequestLoadSnapshotChunk; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.format !== undefined && object.format !== null) { - message.format = Number(object.format); - } else { - message.format = 0; - } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = Number(object.chunk); - } else { - message.chunk = 0; - } - return message; - }, - - toJSON(message: RequestLoadSnapshotChunk): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.format !== undefined && (obj.format = message.format); - message.chunk !== undefined && (obj.chunk = message.chunk); - return obj; - }, - - fromPartial( - object: DeepPartial - ): RequestLoadSnapshotChunk { - const message = { - ...baseRequestLoadSnapshotChunk, - } as RequestLoadSnapshotChunk; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.format !== undefined && object.format !== null) { - message.format = object.format; - } else { - message.format = 0; - } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = object.chunk; - } else { - message.chunk = 0; - } - return message; - }, -}; - -const baseRequestApplySnapshotChunk: object = { index: 0, sender: "" }; - -export const RequestApplySnapshotChunk = { - encode( - message: RequestApplySnapshotChunk, - writer: Writer = Writer.create() - ): Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - if (message.chunk.length !== 0) { - writer.uint32(18).bytes(message.chunk); - } - if (message.sender !== "") { - writer.uint32(26).string(message.sender); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): RequestApplySnapshotChunk { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseRequestApplySnapshotChunk, - } as RequestApplySnapshotChunk; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.chunk = reader.bytes(); - break; - case 3: - message.sender = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestApplySnapshotChunk { - const message = { - ...baseRequestApplySnapshotChunk, - } as RequestApplySnapshotChunk; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = bytesFromBase64(object.chunk); - } - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - return message; - }, - - toJSON(message: RequestApplySnapshotChunk): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.chunk !== undefined && - (obj.chunk = base64FromBytes( - message.chunk !== undefined ? message.chunk : new Uint8Array() - )); - message.sender !== undefined && (obj.sender = message.sender); - return obj; - }, - - fromPartial( - object: DeepPartial - ): RequestApplySnapshotChunk { - const message = { - ...baseRequestApplySnapshotChunk, - } as RequestApplySnapshotChunk; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = object.chunk; - } else { - message.chunk = new Uint8Array(); - } - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - return message; - }, -}; - -const baseResponse: object = {}; - -export const Response = { - encode(message: Response, writer: Writer = Writer.create()): Writer { - if (message.exception !== undefined) { - ResponseException.encode( - message.exception, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.echo !== undefined) { - ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); - } - if (message.flush !== undefined) { - ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim(); - } - if (message.info !== undefined) { - ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); - } - if (message.set_option !== undefined) { - ResponseSetOption.encode( - message.set_option, - writer.uint32(42).fork() - ).ldelim(); - } - if (message.init_chain !== undefined) { - ResponseInitChain.encode( - message.init_chain, - writer.uint32(50).fork() - ).ldelim(); - } - if (message.query !== undefined) { - ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); - } - if (message.begin_block !== undefined) { - ResponseBeginBlock.encode( - message.begin_block, - writer.uint32(66).fork() - ).ldelim(); - } - if (message.check_tx !== undefined) { - ResponseCheckTx.encode( - message.check_tx, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.deliver_tx !== undefined) { - ResponseDeliverTx.encode( - message.deliver_tx, - writer.uint32(82).fork() - ).ldelim(); - } - if (message.end_block !== undefined) { - ResponseEndBlock.encode( - message.end_block, - writer.uint32(90).fork() - ).ldelim(); - } - if (message.commit !== undefined) { - ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); - } - if (message.list_snapshots !== undefined) { - ResponseListSnapshots.encode( - message.list_snapshots, - writer.uint32(106).fork() - ).ldelim(); - } - if (message.offer_snapshot !== undefined) { - ResponseOfferSnapshot.encode( - message.offer_snapshot, - writer.uint32(114).fork() - ).ldelim(); - } - if (message.load_snapshot_chunk !== undefined) { - ResponseLoadSnapshotChunk.encode( - message.load_snapshot_chunk, - writer.uint32(122).fork() - ).ldelim(); - } - if (message.apply_snapshot_chunk !== undefined) { - ResponseApplySnapshotChunk.encode( - message.apply_snapshot_chunk, - writer.uint32(130).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Response { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponse } as Response; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exception = ResponseException.decode(reader, reader.uint32()); - break; - case 2: - message.echo = ResponseEcho.decode(reader, reader.uint32()); - break; - case 3: - message.flush = ResponseFlush.decode(reader, reader.uint32()); - break; - case 4: - message.info = ResponseInfo.decode(reader, reader.uint32()); - break; - case 5: - message.set_option = ResponseSetOption.decode( - reader, - reader.uint32() - ); - break; - case 6: - message.init_chain = ResponseInitChain.decode( - reader, - reader.uint32() - ); - break; - case 7: - message.query = ResponseQuery.decode(reader, reader.uint32()); - break; - case 8: - message.begin_block = ResponseBeginBlock.decode( - reader, - reader.uint32() - ); - break; - case 9: - message.check_tx = ResponseCheckTx.decode(reader, reader.uint32()); - break; - case 10: - message.deliver_tx = ResponseDeliverTx.decode( - reader, - reader.uint32() - ); - break; - case 11: - message.end_block = ResponseEndBlock.decode(reader, reader.uint32()); - break; - case 12: - message.commit = ResponseCommit.decode(reader, reader.uint32()); - break; - case 13: - message.list_snapshots = ResponseListSnapshots.decode( - reader, - reader.uint32() - ); - break; - case 14: - message.offer_snapshot = ResponseOfferSnapshot.decode( - reader, - reader.uint32() - ); - break; - case 15: - message.load_snapshot_chunk = ResponseLoadSnapshotChunk.decode( - reader, - reader.uint32() - ); - break; - case 16: - message.apply_snapshot_chunk = ResponseApplySnapshotChunk.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Response { - const message = { ...baseResponse } as Response; - if (object.exception !== undefined && object.exception !== null) { - message.exception = ResponseException.fromJSON(object.exception); - } else { - message.exception = undefined; - } - if (object.echo !== undefined && object.echo !== null) { - message.echo = ResponseEcho.fromJSON(object.echo); - } else { - message.echo = undefined; - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = ResponseFlush.fromJSON(object.flush); - } else { - message.flush = undefined; - } - if (object.info !== undefined && object.info !== null) { - message.info = ResponseInfo.fromJSON(object.info); - } else { - message.info = undefined; - } - if (object.set_option !== undefined && object.set_option !== null) { - message.set_option = ResponseSetOption.fromJSON(object.set_option); - } else { - message.set_option = undefined; - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.init_chain = ResponseInitChain.fromJSON(object.init_chain); - } else { - message.init_chain = undefined; - } - if (object.query !== undefined && object.query !== null) { - message.query = ResponseQuery.fromJSON(object.query); - } else { - message.query = undefined; - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.begin_block = ResponseBeginBlock.fromJSON(object.begin_block); - } else { - message.begin_block = undefined; - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.check_tx = ResponseCheckTx.fromJSON(object.check_tx); - } else { - message.check_tx = undefined; - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliver_tx = ResponseDeliverTx.fromJSON(object.deliver_tx); - } else { - message.deliver_tx = undefined; - } - if (object.end_block !== undefined && object.end_block !== null) { - message.end_block = ResponseEndBlock.fromJSON(object.end_block); - } else { - message.end_block = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = ResponseCommit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.list_snapshots = ResponseListSnapshots.fromJSON( - object.list_snapshots - ); - } else { - message.list_snapshots = undefined; - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offer_snapshot = ResponseOfferSnapshot.fromJSON( - object.offer_snapshot - ); - } else { - message.offer_snapshot = undefined; - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.load_snapshot_chunk = ResponseLoadSnapshotChunk.fromJSON( - object.load_snapshot_chunk - ); - } else { - message.load_snapshot_chunk = undefined; - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.apply_snapshot_chunk = ResponseApplySnapshotChunk.fromJSON( - object.apply_snapshot_chunk - ); - } else { - message.apply_snapshot_chunk = undefined; - } - return message; - }, - - toJSON(message: Response): unknown { - const obj: any = {}; - message.exception !== undefined && - (obj.exception = message.exception - ? ResponseException.toJSON(message.exception) - : undefined); - message.echo !== undefined && - (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined); - message.flush !== undefined && - (obj.flush = message.flush - ? ResponseFlush.toJSON(message.flush) - : undefined); - message.info !== undefined && - (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined); - message.set_option !== undefined && - (obj.set_option = message.set_option - ? ResponseSetOption.toJSON(message.set_option) - : undefined); - message.init_chain !== undefined && - (obj.init_chain = message.init_chain - ? ResponseInitChain.toJSON(message.init_chain) - : undefined); - message.query !== undefined && - (obj.query = message.query - ? ResponseQuery.toJSON(message.query) - : undefined); - message.begin_block !== undefined && - (obj.begin_block = message.begin_block - ? ResponseBeginBlock.toJSON(message.begin_block) - : undefined); - message.check_tx !== undefined && - (obj.check_tx = message.check_tx - ? ResponseCheckTx.toJSON(message.check_tx) - : undefined); - message.deliver_tx !== undefined && - (obj.deliver_tx = message.deliver_tx - ? ResponseDeliverTx.toJSON(message.deliver_tx) - : undefined); - message.end_block !== undefined && - (obj.end_block = message.end_block - ? ResponseEndBlock.toJSON(message.end_block) - : undefined); - message.commit !== undefined && - (obj.commit = message.commit - ? ResponseCommit.toJSON(message.commit) - : undefined); - message.list_snapshots !== undefined && - (obj.list_snapshots = message.list_snapshots - ? ResponseListSnapshots.toJSON(message.list_snapshots) - : undefined); - message.offer_snapshot !== undefined && - (obj.offer_snapshot = message.offer_snapshot - ? ResponseOfferSnapshot.toJSON(message.offer_snapshot) - : undefined); - message.load_snapshot_chunk !== undefined && - (obj.load_snapshot_chunk = message.load_snapshot_chunk - ? ResponseLoadSnapshotChunk.toJSON(message.load_snapshot_chunk) - : undefined); - message.apply_snapshot_chunk !== undefined && - (obj.apply_snapshot_chunk = message.apply_snapshot_chunk - ? ResponseApplySnapshotChunk.toJSON(message.apply_snapshot_chunk) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Response { - const message = { ...baseResponse } as Response; - if (object.exception !== undefined && object.exception !== null) { - message.exception = ResponseException.fromPartial(object.exception); - } else { - message.exception = undefined; - } - if (object.echo !== undefined && object.echo !== null) { - message.echo = ResponseEcho.fromPartial(object.echo); - } else { - message.echo = undefined; - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = ResponseFlush.fromPartial(object.flush); - } else { - message.flush = undefined; - } - if (object.info !== undefined && object.info !== null) { - message.info = ResponseInfo.fromPartial(object.info); - } else { - message.info = undefined; - } - if (object.set_option !== undefined && object.set_option !== null) { - message.set_option = ResponseSetOption.fromPartial(object.set_option); - } else { - message.set_option = undefined; - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.init_chain = ResponseInitChain.fromPartial(object.init_chain); - } else { - message.init_chain = undefined; - } - if (object.query !== undefined && object.query !== null) { - message.query = ResponseQuery.fromPartial(object.query); - } else { - message.query = undefined; - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.begin_block = ResponseBeginBlock.fromPartial(object.begin_block); - } else { - message.begin_block = undefined; - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.check_tx = ResponseCheckTx.fromPartial(object.check_tx); - } else { - message.check_tx = undefined; - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliver_tx = ResponseDeliverTx.fromPartial(object.deliver_tx); - } else { - message.deliver_tx = undefined; - } - if (object.end_block !== undefined && object.end_block !== null) { - message.end_block = ResponseEndBlock.fromPartial(object.end_block); - } else { - message.end_block = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = ResponseCommit.fromPartial(object.commit); - } else { - message.commit = undefined; - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.list_snapshots = ResponseListSnapshots.fromPartial( - object.list_snapshots - ); - } else { - message.list_snapshots = undefined; - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offer_snapshot = ResponseOfferSnapshot.fromPartial( - object.offer_snapshot - ); - } else { - message.offer_snapshot = undefined; - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.load_snapshot_chunk = ResponseLoadSnapshotChunk.fromPartial( - object.load_snapshot_chunk - ); - } else { - message.load_snapshot_chunk = undefined; - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.apply_snapshot_chunk = ResponseApplySnapshotChunk.fromPartial( - object.apply_snapshot_chunk - ); - } else { - message.apply_snapshot_chunk = undefined; - } - return message; - }, -}; - -const baseResponseException: object = { error: "" }; - -export const ResponseException = { - encode(message: ResponseException, writer: Writer = Writer.create()): Writer { - if (message.error !== "") { - writer.uint32(10).string(message.error); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseException { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseException } as ResponseException; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.error = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseException { - const message = { ...baseResponseException } as ResponseException; - if (object.error !== undefined && object.error !== null) { - message.error = String(object.error); - } else { - message.error = ""; - } - return message; - }, - - toJSON(message: ResponseException): unknown { - const obj: any = {}; - message.error !== undefined && (obj.error = message.error); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseException { - const message = { ...baseResponseException } as ResponseException; - if (object.error !== undefined && object.error !== null) { - message.error = object.error; - } else { - message.error = ""; - } - return message; - }, -}; - -const baseResponseEcho: object = { message: "" }; - -export const ResponseEcho = { - encode(message: ResponseEcho, writer: Writer = Writer.create()): Writer { - if (message.message !== "") { - writer.uint32(10).string(message.message); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseEcho { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseEcho } as ResponseEcho; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseEcho { - const message = { ...baseResponseEcho } as ResponseEcho; - if (object.message !== undefined && object.message !== null) { - message.message = String(object.message); - } else { - message.message = ""; - } - return message; - }, - - toJSON(message: ResponseEcho): unknown { - const obj: any = {}; - message.message !== undefined && (obj.message = message.message); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseEcho { - const message = { ...baseResponseEcho } as ResponseEcho; - if (object.message !== undefined && object.message !== null) { - message.message = object.message; - } else { - message.message = ""; - } - return message; - }, -}; - -const baseResponseFlush: object = {}; - -export const ResponseFlush = { - encode(_: ResponseFlush, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseFlush { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseFlush } as ResponseFlush; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): ResponseFlush { - const message = { ...baseResponseFlush } as ResponseFlush; - return message; - }, - - toJSON(_: ResponseFlush): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): ResponseFlush { - const message = { ...baseResponseFlush } as ResponseFlush; - return message; - }, -}; - -const baseResponseInfo: object = { - data: "", - version: "", - app_version: 0, - last_block_height: 0, -}; - -export const ResponseInfo = { - encode(message: ResponseInfo, writer: Writer = Writer.create()): Writer { - if (message.data !== "") { - writer.uint32(10).string(message.data); - } - if (message.version !== "") { - writer.uint32(18).string(message.version); - } - if (message.app_version !== 0) { - writer.uint32(24).uint64(message.app_version); - } - if (message.last_block_height !== 0) { - writer.uint32(32).int64(message.last_block_height); - } - if (message.last_block_app_hash.length !== 0) { - writer.uint32(42).bytes(message.last_block_app_hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseInfo } as ResponseInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - case 3: - message.app_version = longToNumber(reader.uint64() as Long); - break; - case 4: - message.last_block_height = longToNumber(reader.int64() as Long); - break; - case 5: - message.last_block_app_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseInfo { - const message = { ...baseResponseInfo } as ResponseInfo; - if (object.data !== undefined && object.data !== null) { - message.data = String(object.data); - } else { - message.data = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.app_version !== undefined && object.app_version !== null) { - message.app_version = Number(object.app_version); - } else { - message.app_version = 0; - } - if ( - object.last_block_height !== undefined && - object.last_block_height !== null - ) { - message.last_block_height = Number(object.last_block_height); - } else { - message.last_block_height = 0; - } - if ( - object.last_block_app_hash !== undefined && - object.last_block_app_hash !== null - ) { - message.last_block_app_hash = bytesFromBase64(object.last_block_app_hash); - } - return message; - }, - - toJSON(message: ResponseInfo): unknown { - const obj: any = {}; - message.data !== undefined && (obj.data = message.data); - message.version !== undefined && (obj.version = message.version); - message.app_version !== undefined && - (obj.app_version = message.app_version); - message.last_block_height !== undefined && - (obj.last_block_height = message.last_block_height); - message.last_block_app_hash !== undefined && - (obj.last_block_app_hash = base64FromBytes( - message.last_block_app_hash !== undefined - ? message.last_block_app_hash - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseInfo { - const message = { ...baseResponseInfo } as ResponseInfo; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.app_version !== undefined && object.app_version !== null) { - message.app_version = object.app_version; - } else { - message.app_version = 0; - } - if ( - object.last_block_height !== undefined && - object.last_block_height !== null - ) { - message.last_block_height = object.last_block_height; - } else { - message.last_block_height = 0; - } - if ( - object.last_block_app_hash !== undefined && - object.last_block_app_hash !== null - ) { - message.last_block_app_hash = object.last_block_app_hash; - } else { - message.last_block_app_hash = new Uint8Array(); - } - return message; - }, -}; - -const baseResponseSetOption: object = { code: 0, log: "", info: "" }; - -export const ResponseSetOption = { - encode(message: ResponseSetOption, writer: Writer = Writer.create()): Writer { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); - } - if (message.log !== "") { - writer.uint32(26).string(message.log); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseSetOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseSetOption } as ResponseSetOption; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseSetOption { - const message = { ...baseResponseSetOption } as ResponseSetOption; - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - return message; - }, - - toJSON(message: ResponseSetOption): unknown { - const obj: any = {}; - message.code !== undefined && (obj.code = message.code); - message.log !== undefined && (obj.log = message.log); - message.info !== undefined && (obj.info = message.info); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseSetOption { - const message = { ...baseResponseSetOption } as ResponseSetOption; - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - return message; - }, -}; - -const baseResponseInitChain: object = {}; - -export const ResponseInitChain = { - encode(message: ResponseInitChain, writer: Writer = Writer.create()): Writer { - if (message.consensus_params !== undefined) { - ConsensusParams.encode( - message.consensus_params, - writer.uint32(10).fork() - ).ldelim(); - } - for (const v of message.validators) { - ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.app_hash.length !== 0) { - writer.uint32(26).bytes(message.app_hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseInitChain { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseInitChain } as ResponseInitChain; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_params = ConsensusParams.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.validators.push( - ValidatorUpdate.decode(reader, reader.uint32()) - ); - break; - case 3: - message.app_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseInitChain { - const message = { ...baseResponseInitChain } as ResponseInitChain; - message.validators = []; - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensus_params = ConsensusParams.fromJSON( - object.consensus_params - ); - } else { - message.consensus_params = undefined; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(ValidatorUpdate.fromJSON(e)); - } - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - return message; - }, - - toJSON(message: ResponseInitChain): unknown { - const obj: any = {}; - message.consensus_params !== undefined && - (obj.consensus_params = message.consensus_params - ? ConsensusParams.toJSON(message.consensus_params) - : undefined); - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? ValidatorUpdate.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseInitChain { - const message = { ...baseResponseInitChain } as ResponseInitChain; - message.validators = []; - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensus_params = ConsensusParams.fromPartial( - object.consensus_params - ); - } else { - message.consensus_params = undefined; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(ValidatorUpdate.fromPartial(e)); - } - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } - return message; - }, -}; - -const baseResponseQuery: object = { - code: 0, - log: "", - info: "", - index: 0, - height: 0, - codespace: "", -}; - -export const ResponseQuery = { - encode(message: ResponseQuery, writer: Writer = Writer.create()): Writer { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); - } - if (message.log !== "") { - writer.uint32(26).string(message.log); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - if (message.index !== 0) { - writer.uint32(40).int64(message.index); - } - if (message.key.length !== 0) { - writer.uint32(50).bytes(message.key); - } - if (message.value.length !== 0) { - writer.uint32(58).bytes(message.value); - } - if (message.proof_ops !== undefined) { - ProofOps.encode(message.proof_ops, writer.uint32(66).fork()).ldelim(); - } - if (message.height !== 0) { - writer.uint32(72).int64(message.height); - } - if (message.codespace !== "") { - writer.uint32(82).string(message.codespace); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseQuery { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseQuery } as ResponseQuery; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - case 5: - message.index = longToNumber(reader.int64() as Long); - break; - case 6: - message.key = reader.bytes(); - break; - case 7: - message.value = reader.bytes(); - break; - case 8: - message.proof_ops = ProofOps.decode(reader, reader.uint32()); - break; - case 9: - message.height = longToNumber(reader.int64() as Long); - break; - case 10: - message.codespace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseQuery { - const message = { ...baseResponseQuery } as ResponseQuery; - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - if (object.proof_ops !== undefined && object.proof_ops !== null) { - message.proof_ops = ProofOps.fromJSON(object.proof_ops); - } else { - message.proof_ops = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = String(object.codespace); - } else { - message.codespace = ""; - } - return message; - }, - - toJSON(message: ResponseQuery): unknown { - const obj: any = {}; - message.code !== undefined && (obj.code = message.code); - message.log !== undefined && (obj.log = message.log); - message.info !== undefined && (obj.info = message.info); - message.index !== undefined && (obj.index = message.index); - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - message.proof_ops !== undefined && - (obj.proof_ops = message.proof_ops - ? ProofOps.toJSON(message.proof_ops) - : undefined); - message.height !== undefined && (obj.height = message.height); - message.codespace !== undefined && (obj.codespace = message.codespace); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseQuery { - const message = { ...baseResponseQuery } as ResponseQuery; - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - if (object.proof_ops !== undefined && object.proof_ops !== null) { - message.proof_ops = ProofOps.fromPartial(object.proof_ops); - } else { - message.proof_ops = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } else { - message.codespace = ""; - } - return message; - }, -}; - -const baseResponseBeginBlock: object = {}; - -export const ResponseBeginBlock = { - encode( - message: ResponseBeginBlock, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.events) { - Event.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseBeginBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; - message.events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.events.push(Event.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseBeginBlock { - const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; - message.events = []; - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ResponseBeginBlock): unknown { - const obj: any = {}; - if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); - } else { - obj.events = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ResponseBeginBlock { - const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; - message.events = []; - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } - return message; - }, -}; - -const baseResponseCheckTx: object = { - code: 0, - log: "", - info: "", - gas_wanted: 0, - gas_used: 0, - codespace: "", -}; - -export const ResponseCheckTx = { - encode(message: ResponseCheckTx, writer: Writer = Writer.create()): Writer { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - if (message.log !== "") { - writer.uint32(26).string(message.log); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - if (message.gas_wanted !== 0) { - writer.uint32(40).int64(message.gas_wanted); - } - if (message.gas_used !== 0) { - writer.uint32(48).int64(message.gas_used); - } - for (const v of message.events) { - Event.encode(v!, writer.uint32(58).fork()).ldelim(); - } - if (message.codespace !== "") { - writer.uint32(66).string(message.codespace); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseCheckTx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseCheckTx } as ResponseCheckTx; - message.events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - case 5: - message.gas_wanted = longToNumber(reader.int64() as Long); - break; - case 6: - message.gas_used = longToNumber(reader.int64() as Long); - break; - case 7: - message.events.push(Event.decode(reader, reader.uint32())); - break; - case 8: - message.codespace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseCheckTx { - const message = { ...baseResponseCheckTx } as ResponseCheckTx; - message.events = []; - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = Number(object.gas_wanted); - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = Number(object.gas_used); - } else { - message.gas_used = 0; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = String(object.codespace); - } else { - message.codespace = ""; - } - return message; - }, - - toJSON(message: ResponseCheckTx): unknown { - const obj: any = {}; - message.code !== undefined && (obj.code = message.code); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.log !== undefined && (obj.log = message.log); - message.info !== undefined && (obj.info = message.info); - message.gas_wanted !== undefined && (obj.gas_wanted = message.gas_wanted); - message.gas_used !== undefined && (obj.gas_used = message.gas_used); - if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); - } else { - obj.events = []; - } - message.codespace !== undefined && (obj.codespace = message.codespace); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseCheckTx { - const message = { ...baseResponseCheckTx } as ResponseCheckTx; - message.events = []; - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = object.gas_wanted; - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = object.gas_used; - } else { - message.gas_used = 0; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } else { - message.codespace = ""; - } - return message; - }, -}; - -const baseResponseDeliverTx: object = { - code: 0, - log: "", - info: "", - gas_wanted: 0, - gas_used: 0, - codespace: "", -}; - -export const ResponseDeliverTx = { - encode(message: ResponseDeliverTx, writer: Writer = Writer.create()): Writer { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - if (message.log !== "") { - writer.uint32(26).string(message.log); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - if (message.gas_wanted !== 0) { - writer.uint32(40).int64(message.gas_wanted); - } - if (message.gas_used !== 0) { - writer.uint32(48).int64(message.gas_used); - } - for (const v of message.events) { - Event.encode(v!, writer.uint32(58).fork()).ldelim(); - } - if (message.codespace !== "") { - writer.uint32(66).string(message.codespace); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseDeliverTx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; - message.events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - case 5: - message.gas_wanted = longToNumber(reader.int64() as Long); - break; - case 6: - message.gas_used = longToNumber(reader.int64() as Long); - break; - case 7: - message.events.push(Event.decode(reader, reader.uint32())); - break; - case 8: - message.codespace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseDeliverTx { - const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; - message.events = []; - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = Number(object.gas_wanted); - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = Number(object.gas_used); - } else { - message.gas_used = 0; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = String(object.codespace); - } else { - message.codespace = ""; - } - return message; - }, - - toJSON(message: ResponseDeliverTx): unknown { - const obj: any = {}; - message.code !== undefined && (obj.code = message.code); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.log !== undefined && (obj.log = message.log); - message.info !== undefined && (obj.info = message.info); - message.gas_wanted !== undefined && (obj.gas_wanted = message.gas_wanted); - message.gas_used !== undefined && (obj.gas_used = message.gas_used); - if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); - } else { - obj.events = []; - } - message.codespace !== undefined && (obj.codespace = message.codespace); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseDeliverTx { - const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; - message.events = []; - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = object.gas_wanted; - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = object.gas_used; - } else { - message.gas_used = 0; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } else { - message.codespace = ""; - } - return message; - }, -}; - -const baseResponseEndBlock: object = {}; - -export const ResponseEndBlock = { - encode(message: ResponseEndBlock, writer: Writer = Writer.create()): Writer { - for (const v of message.validator_updates) { - ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.consensus_param_updates !== undefined) { - ConsensusParams.encode( - message.consensus_param_updates, - writer.uint32(18).fork() - ).ldelim(); - } - for (const v of message.events) { - Event.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseEndBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseEndBlock } as ResponseEndBlock; - message.validator_updates = []; - message.events = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_updates.push( - ValidatorUpdate.decode(reader, reader.uint32()) - ); - break; - case 2: - message.consensus_param_updates = ConsensusParams.decode( - reader, - reader.uint32() - ); - break; - case 3: - message.events.push(Event.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseEndBlock { - const message = { ...baseResponseEndBlock } as ResponseEndBlock; - message.validator_updates = []; - message.events = []; - if ( - object.validator_updates !== undefined && - object.validator_updates !== null - ) { - for (const e of object.validator_updates) { - message.validator_updates.push(ValidatorUpdate.fromJSON(e)); - } - } - if ( - object.consensus_param_updates !== undefined && - object.consensus_param_updates !== null - ) { - message.consensus_param_updates = ConsensusParams.fromJSON( - object.consensus_param_updates - ); - } else { - message.consensus_param_updates = undefined; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ResponseEndBlock): unknown { - const obj: any = {}; - if (message.validator_updates) { - obj.validator_updates = message.validator_updates.map((e) => - e ? ValidatorUpdate.toJSON(e) : undefined - ); - } else { - obj.validator_updates = []; - } - message.consensus_param_updates !== undefined && - (obj.consensus_param_updates = message.consensus_param_updates - ? ConsensusParams.toJSON(message.consensus_param_updates) - : undefined); - if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); - } else { - obj.events = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ResponseEndBlock { - const message = { ...baseResponseEndBlock } as ResponseEndBlock; - message.validator_updates = []; - message.events = []; - if ( - object.validator_updates !== undefined && - object.validator_updates !== null - ) { - for (const e of object.validator_updates) { - message.validator_updates.push(ValidatorUpdate.fromPartial(e)); - } - } - if ( - object.consensus_param_updates !== undefined && - object.consensus_param_updates !== null - ) { - message.consensus_param_updates = ConsensusParams.fromPartial( - object.consensus_param_updates - ); - } else { - message.consensus_param_updates = undefined; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } - return message; - }, -}; - -const baseResponseCommit: object = { retain_height: 0 }; - -export const ResponseCommit = { - encode(message: ResponseCommit, writer: Writer = Writer.create()): Writer { - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - if (message.retain_height !== 0) { - writer.uint32(24).int64(message.retain_height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseCommit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseCommit } as ResponseCommit; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.data = reader.bytes(); - break; - case 3: - message.retain_height = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseCommit { - const message = { ...baseResponseCommit } as ResponseCommit; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.retain_height !== undefined && object.retain_height !== null) { - message.retain_height = Number(object.retain_height); - } else { - message.retain_height = 0; - } - return message; - }, - - toJSON(message: ResponseCommit): unknown { - const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.retain_height !== undefined && - (obj.retain_height = message.retain_height); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseCommit { - const message = { ...baseResponseCommit } as ResponseCommit; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.retain_height !== undefined && object.retain_height !== null) { - message.retain_height = object.retain_height; - } else { - message.retain_height = 0; - } - return message; - }, -}; - -const baseResponseListSnapshots: object = {}; - -export const ResponseListSnapshots = { - encode( - message: ResponseListSnapshots, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.snapshots) { - Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseListSnapshots { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; - message.snapshots = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.snapshots.push(Snapshot.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseListSnapshots { - const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; - message.snapshots = []; - if (object.snapshots !== undefined && object.snapshots !== null) { - for (const e of object.snapshots) { - message.snapshots.push(Snapshot.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ResponseListSnapshots): unknown { - const obj: any = {}; - if (message.snapshots) { - obj.snapshots = message.snapshots.map((e) => - e ? Snapshot.toJSON(e) : undefined - ); - } else { - obj.snapshots = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ResponseListSnapshots { - const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; - message.snapshots = []; - if (object.snapshots !== undefined && object.snapshots !== null) { - for (const e of object.snapshots) { - message.snapshots.push(Snapshot.fromPartial(e)); - } - } - return message; - }, -}; - -const baseResponseOfferSnapshot: object = { result: 0 }; - -export const ResponseOfferSnapshot = { - encode( - message: ResponseOfferSnapshot, - writer: Writer = Writer.create() - ): Writer { - if (message.result !== 0) { - writer.uint32(8).int32(message.result); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseOfferSnapshot { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseOfferSnapshot { - const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; - if (object.result !== undefined && object.result !== null) { - message.result = responseOfferSnapshot_ResultFromJSON(object.result); - } else { - message.result = 0; - } - return message; - }, - - toJSON(message: ResponseOfferSnapshot): unknown { - const obj: any = {}; - message.result !== undefined && - (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ResponseOfferSnapshot { - const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } else { - message.result = 0; - } - return message; - }, -}; - -const baseResponseLoadSnapshotChunk: object = {}; - -export const ResponseLoadSnapshotChunk = { - encode( - message: ResponseLoadSnapshotChunk, - writer: Writer = Writer.create() - ): Writer { - if (message.chunk.length !== 0) { - writer.uint32(10).bytes(message.chunk); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ResponseLoadSnapshotChunk { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseResponseLoadSnapshotChunk, - } as ResponseLoadSnapshotChunk; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.chunk = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseLoadSnapshotChunk { - const message = { - ...baseResponseLoadSnapshotChunk, - } as ResponseLoadSnapshotChunk; - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = bytesFromBase64(object.chunk); - } - return message; - }, - - toJSON(message: ResponseLoadSnapshotChunk): unknown { - const obj: any = {}; - message.chunk !== undefined && - (obj.chunk = base64FromBytes( - message.chunk !== undefined ? message.chunk : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ResponseLoadSnapshotChunk { - const message = { - ...baseResponseLoadSnapshotChunk, - } as ResponseLoadSnapshotChunk; - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = object.chunk; - } else { - message.chunk = new Uint8Array(); - } - return message; - }, -}; - -const baseResponseApplySnapshotChunk: object = { - result: 0, - refetch_chunks: 0, - reject_senders: "", -}; - -export const ResponseApplySnapshotChunk = { - encode( - message: ResponseApplySnapshotChunk, - writer: Writer = Writer.create() - ): Writer { - if (message.result !== 0) { - writer.uint32(8).int32(message.result); - } - writer.uint32(18).fork(); - for (const v of message.refetch_chunks) { - writer.uint32(v); - } - writer.ldelim(); - for (const v of message.reject_senders) { - writer.uint32(26).string(v!); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ResponseApplySnapshotChunk { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseResponseApplySnapshotChunk, - } as ResponseApplySnapshotChunk; - message.refetch_chunks = []; - message.reject_senders = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32() as any; - break; - case 2: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.refetch_chunks.push(reader.uint32()); - } - } else { - message.refetch_chunks.push(reader.uint32()); - } - break; - case 3: - message.reject_senders.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseApplySnapshotChunk { - const message = { - ...baseResponseApplySnapshotChunk, - } as ResponseApplySnapshotChunk; - message.refetch_chunks = []; - message.reject_senders = []; - if (object.result !== undefined && object.result !== null) { - message.result = responseApplySnapshotChunk_ResultFromJSON(object.result); - } else { - message.result = 0; - } - if (object.refetch_chunks !== undefined && object.refetch_chunks !== null) { - for (const e of object.refetch_chunks) { - message.refetch_chunks.push(Number(e)); - } - } - if (object.reject_senders !== undefined && object.reject_senders !== null) { - for (const e of object.reject_senders) { - message.reject_senders.push(String(e)); - } - } - return message; - }, - - toJSON(message: ResponseApplySnapshotChunk): unknown { - const obj: any = {}; - message.result !== undefined && - (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result)); - if (message.refetch_chunks) { - obj.refetch_chunks = message.refetch_chunks.map((e) => e); - } else { - obj.refetch_chunks = []; - } - if (message.reject_senders) { - obj.reject_senders = message.reject_senders.map((e) => e); - } else { - obj.reject_senders = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ResponseApplySnapshotChunk { - const message = { - ...baseResponseApplySnapshotChunk, - } as ResponseApplySnapshotChunk; - message.refetch_chunks = []; - message.reject_senders = []; - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } else { - message.result = 0; - } - if (object.refetch_chunks !== undefined && object.refetch_chunks !== null) { - for (const e of object.refetch_chunks) { - message.refetch_chunks.push(e); - } - } - if (object.reject_senders !== undefined && object.reject_senders !== null) { - for (const e of object.reject_senders) { - message.reject_senders.push(e); - } - } - return message; - }, -}; - -const baseConsensusParams: object = {}; - -export const ConsensusParams = { - encode(message: ConsensusParams, writer: Writer = Writer.create()): Writer { - if (message.block !== undefined) { - BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); - } - if (message.evidence !== undefined) { - EvidenceParams.encode( - message.evidence, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.validator !== undefined) { - ValidatorParams.encode( - message.validator, - writer.uint32(26).fork() - ).ldelim(); - } - if (message.version !== undefined) { - VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ConsensusParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensusParams } as ConsensusParams; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = BlockParams.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = EvidenceParams.decode(reader, reader.uint32()); - break; - case 3: - message.validator = ValidatorParams.decode(reader, reader.uint32()); - break; - case 4: - message.version = VersionParams.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConsensusParams { - const message = { ...baseConsensusParams } as ConsensusParams; - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromJSON(object.block); - } else { - message.block = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromJSON(object.validator); - } else { - message.validator = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromJSON(object.version); - } else { - message.version = undefined; - } - return message; - }, - - toJSON(message: ConsensusParams): unknown { - const obj: any = {}; - message.block !== undefined && - (obj.block = message.block - ? BlockParams.toJSON(message.block) - : undefined); - message.evidence !== undefined && - (obj.evidence = message.evidence - ? EvidenceParams.toJSON(message.evidence) - : undefined); - message.validator !== undefined && - (obj.validator = message.validator - ? ValidatorParams.toJSON(message.validator) - : undefined); - message.version !== undefined && - (obj.version = message.version - ? VersionParams.toJSON(message.version) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): ConsensusParams { - const message = { ...baseConsensusParams } as ConsensusParams; - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromPartial(object.block); - } else { - message.block = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromPartial(object.validator); - } else { - message.validator = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromPartial(object.version); - } else { - message.version = undefined; - } - return message; - }, -}; - -const baseBlockParams: object = { max_bytes: 0, max_gas: 0 }; - -export const BlockParams = { - encode(message: BlockParams, writer: Writer = Writer.create()): Writer { - if (message.max_bytes !== 0) { - writer.uint32(8).int64(message.max_bytes); - } - if (message.max_gas !== 0) { - writer.uint32(16).int64(message.max_gas); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BlockParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockParams } as BlockParams; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_bytes = longToNumber(reader.int64() as Long); - break; - case 2: - message.max_gas = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BlockParams { - const message = { ...baseBlockParams } as BlockParams; - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = Number(object.max_bytes); - } else { - message.max_bytes = 0; - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.max_gas = Number(object.max_gas); - } else { - message.max_gas = 0; - } - return message; - }, - - toJSON(message: BlockParams): unknown { - const obj: any = {}; - message.max_bytes !== undefined && (obj.max_bytes = message.max_bytes); - message.max_gas !== undefined && (obj.max_gas = message.max_gas); - return obj; - }, - - fromPartial(object: DeepPartial): BlockParams { - const message = { ...baseBlockParams } as BlockParams; - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = object.max_bytes; - } else { - message.max_bytes = 0; - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.max_gas = object.max_gas; - } else { - message.max_gas = 0; - } - return message; - }, -}; - -const baseLastCommitInfo: object = { round: 0 }; - -export const LastCommitInfo = { - encode(message: LastCommitInfo, writer: Writer = Writer.create()): Writer { - if (message.round !== 0) { - writer.uint32(8).int32(message.round); - } - for (const v of message.votes) { - VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): LastCommitInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLastCommitInfo } as LastCommitInfo; - message.votes = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.round = reader.int32(); - break; - case 2: - message.votes.push(VoteInfo.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LastCommitInfo { - const message = { ...baseLastCommitInfo } as LastCommitInfo; - message.votes = []; - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(VoteInfo.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: LastCommitInfo): unknown { - const obj: any = {}; - message.round !== undefined && (obj.round = message.round); - if (message.votes) { - obj.votes = message.votes.map((e) => - e ? VoteInfo.toJSON(e) : undefined - ); - } else { - obj.votes = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): LastCommitInfo { - const message = { ...baseLastCommitInfo } as LastCommitInfo; - message.votes = []; - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(VoteInfo.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEvent: object = { type: "" }; - -export const Event = { - encode(message: Event, writer: Writer = Writer.create()): Writer { - if (message.type !== "") { - writer.uint32(10).string(message.type); - } - for (const v of message.attributes) { - EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Event { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvent } as Event; - message.attributes = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.attributes.push( - EventAttribute.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Event { - const message = { ...baseEvent } as Event; - message.attributes = []; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.attributes !== undefined && object.attributes !== null) { - for (const e of object.attributes) { - message.attributes.push(EventAttribute.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Event): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = message.type); - if (message.attributes) { - obj.attributes = message.attributes.map((e) => - e ? EventAttribute.toJSON(e) : undefined - ); - } else { - obj.attributes = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Event { - const message = { ...baseEvent } as Event; - message.attributes = []; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.attributes !== undefined && object.attributes !== null) { - for (const e of object.attributes) { - message.attributes.push(EventAttribute.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEventAttribute: object = { index: false }; - -export const EventAttribute = { - encode(message: EventAttribute, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - if (message.index === true) { - writer.uint32(24).bool(message.index); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EventAttribute { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEventAttribute } as EventAttribute; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - case 3: - message.index = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EventAttribute { - const message = { ...baseEventAttribute } as EventAttribute; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - if (object.index !== undefined && object.index !== null) { - message.index = Boolean(object.index); - } else { - message.index = false; - } - return message; - }, - - toJSON(message: EventAttribute): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - message.index !== undefined && (obj.index = message.index); - return obj; - }, - - fromPartial(object: DeepPartial): EventAttribute { - const message = { ...baseEventAttribute } as EventAttribute; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = false; - } - return message; - }, -}; - -const baseTxResult: object = { height: 0, index: 0 }; - -export const TxResult = { - encode(message: TxResult, writer: Writer = Writer.create()): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - if (message.index !== 0) { - writer.uint32(16).uint32(message.index); - } - if (message.tx.length !== 0) { - writer.uint32(26).bytes(message.tx); - } - if (message.result !== undefined) { - ResponseDeliverTx.encode( - message.result, - writer.uint32(34).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TxResult { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxResult } as TxResult; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - case 2: - message.index = reader.uint32(); - break; - case 3: - message.tx = reader.bytes(); - break; - case 4: - message.result = ResponseDeliverTx.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TxResult { - const message = { ...baseTxResult } as TxResult; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - if (object.result !== undefined && object.result !== null) { - message.result = ResponseDeliverTx.fromJSON(object.result); - } else { - message.result = undefined; - } - return message; - }, - - toJSON(message: TxResult): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.index !== undefined && (obj.index = message.index); - message.tx !== undefined && - (obj.tx = base64FromBytes( - message.tx !== undefined ? message.tx : new Uint8Array() - )); - message.result !== undefined && - (obj.result = message.result - ? ResponseDeliverTx.toJSON(message.result) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): TxResult { - const message = { ...baseTxResult } as TxResult; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = object.tx; - } else { - message.tx = new Uint8Array(); - } - if (object.result !== undefined && object.result !== null) { - message.result = ResponseDeliverTx.fromPartial(object.result); - } else { - message.result = undefined; - } - return message; - }, -}; - -const baseValidator: object = { power: 0 }; - -export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { - if (message.address.length !== 0) { - writer.uint32(10).bytes(message.address); - } - if (message.power !== 0) { - writer.uint32(24).int64(message.power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.bytes(); - break; - case 3: - message.power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.power !== undefined && object.power !== null) { - message.power = Number(object.power); - } else { - message.power = 0; - } - return message; - }, - - toJSON(message: Validator): unknown { - const obj: any = {}; - message.address !== undefined && - (obj.address = base64FromBytes( - message.address !== undefined ? message.address : new Uint8Array() - )); - message.power !== undefined && (obj.power = message.power); - return obj; - }, - - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = new Uint8Array(); - } - if (object.power !== undefined && object.power !== null) { - message.power = object.power; - } else { - message.power = 0; - } - return message; - }, -}; - -const baseValidatorUpdate: object = { power: 0 }; - -export const ValidatorUpdate = { - encode(message: ValidatorUpdate, writer: Writer = Writer.create()): Writer { - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(10).fork()).ldelim(); - } - if (message.power !== 0) { - writer.uint32(16).int64(message.power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorUpdate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorUpdate } as ValidatorUpdate; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pub_key = PublicKey.decode(reader, reader.uint32()); - break; - case 2: - message.power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorUpdate { - const message = { ...baseValidatorUpdate } as ValidatorUpdate; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.power !== undefined && object.power !== null) { - message.power = Number(object.power); - } else { - message.power = 0; - } - return message; - }, - - toJSON(message: ValidatorUpdate): unknown { - const obj: any = {}; - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.power !== undefined && (obj.power = message.power); - return obj; - }, - - fromPartial(object: DeepPartial): ValidatorUpdate { - const message = { ...baseValidatorUpdate } as ValidatorUpdate; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.power !== undefined && object.power !== null) { - message.power = object.power; - } else { - message.power = 0; - } - return message; - }, -}; - -const baseVoteInfo: object = { signed_last_block: false }; - -export const VoteInfo = { - encode(message: VoteInfo, writer: Writer = Writer.create()): Writer { - if (message.validator !== undefined) { - Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); - } - if (message.signed_last_block === true) { - writer.uint32(16).bool(message.signed_last_block); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): VoteInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVoteInfo } as VoteInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator = Validator.decode(reader, reader.uint32()); - break; - case 2: - message.signed_last_block = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): VoteInfo { - const message = { ...baseVoteInfo } as VoteInfo; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromJSON(object.validator); - } else { - message.validator = undefined; - } - if ( - object.signed_last_block !== undefined && - object.signed_last_block !== null - ) { - message.signed_last_block = Boolean(object.signed_last_block); - } else { - message.signed_last_block = false; - } - return message; - }, - - toJSON(message: VoteInfo): unknown { - const obj: any = {}; - message.validator !== undefined && - (obj.validator = message.validator - ? Validator.toJSON(message.validator) - : undefined); - message.signed_last_block !== undefined && - (obj.signed_last_block = message.signed_last_block); - return obj; - }, - - fromPartial(object: DeepPartial): VoteInfo { - const message = { ...baseVoteInfo } as VoteInfo; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromPartial(object.validator); - } else { - message.validator = undefined; - } - if ( - object.signed_last_block !== undefined && - object.signed_last_block !== null - ) { - message.signed_last_block = object.signed_last_block; - } else { - message.signed_last_block = false; - } - return message; - }, -}; - -const baseEvidence: object = { type: 0, height: 0, total_voting_power: 0 }; - -export const Evidence = { - encode(message: Evidence, writer: Writer = Writer.create()): Writer { - if (message.type !== 0) { - writer.uint32(8).int32(message.type); - } - if (message.validator !== undefined) { - Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(34).fork() - ).ldelim(); - } - if (message.total_voting_power !== 0) { - writer.uint32(40).int64(message.total_voting_power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Evidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidence } as Evidence; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32() as any; - break; - case 2: - message.validator = Validator.decode(reader, reader.uint32()); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 5: - message.total_voting_power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Evidence { - const message = { ...baseEvidence } as Evidence; - if (object.type !== undefined && object.type !== null) { - message.type = evidenceTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromJSON(object.validator); - } else { - message.validator = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - return message; - }, - - toJSON(message: Evidence): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = evidenceTypeToJSON(message.type)); - message.validator !== undefined && - (obj.validator = message.validator - ? Validator.toJSON(message.validator) - : undefined); - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - return obj; - }, - - fromPartial(object: DeepPartial): Evidence { - const message = { ...baseEvidence } as Evidence; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromPartial(object.validator); - } else { - message.validator = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - return message; - }, -}; - -const baseSnapshot: object = { height: 0, format: 0, chunks: 0 }; - -export const Snapshot = { - encode(message: Snapshot, writer: Writer = Writer.create()): Writer { - if (message.height !== 0) { - writer.uint32(8).uint64(message.height); - } - if (message.format !== 0) { - writer.uint32(16).uint32(message.format); - } - if (message.chunks !== 0) { - writer.uint32(24).uint32(message.chunks); - } - if (message.hash.length !== 0) { - writer.uint32(34).bytes(message.hash); - } - if (message.metadata.length !== 0) { - writer.uint32(42).bytes(message.metadata); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Snapshot { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSnapshot } as Snapshot; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.uint64() as Long); - break; - case 2: - message.format = reader.uint32(); - break; - case 3: - message.chunks = reader.uint32(); - break; - case 4: - message.hash = reader.bytes(); - break; - case 5: - message.metadata = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Snapshot { - const message = { ...baseSnapshot } as Snapshot; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.format !== undefined && object.format !== null) { - message.format = Number(object.format); - } else { - message.format = 0; - } - if (object.chunks !== undefined && object.chunks !== null) { - message.chunks = Number(object.chunks); - } else { - message.chunks = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = bytesFromBase64(object.metadata); - } - return message; - }, - - toJSON(message: Snapshot): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.format !== undefined && (obj.format = message.format); - message.chunks !== undefined && (obj.chunks = message.chunks); - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.metadata !== undefined && - (obj.metadata = base64FromBytes( - message.metadata !== undefined ? message.metadata : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Snapshot { - const message = { ...baseSnapshot } as Snapshot; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.format !== undefined && object.format !== null) { - message.format = object.format; - } else { - message.format = 0; - } - if (object.chunks !== undefined && object.chunks !== null) { - message.chunks = object.chunks; - } else { - message.chunks = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } else { - message.metadata = new Uint8Array(); - } - return message; - }, -}; - -export interface ABCIApplication { - Echo(request: RequestEcho): Promise; - Flush(request: RequestFlush): Promise; - Info(request: RequestInfo): Promise; - SetOption(request: RequestSetOption): Promise; - DeliverTx(request: RequestDeliverTx): Promise; - CheckTx(request: RequestCheckTx): Promise; - Query(request: RequestQuery): Promise; - Commit(request: RequestCommit): Promise; - InitChain(request: RequestInitChain): Promise; - BeginBlock(request: RequestBeginBlock): Promise; - EndBlock(request: RequestEndBlock): Promise; - ListSnapshots(request: RequestListSnapshots): Promise; - OfferSnapshot(request: RequestOfferSnapshot): Promise; - LoadSnapshotChunk( - request: RequestLoadSnapshotChunk - ): Promise; - ApplySnapshotChunk( - request: RequestApplySnapshotChunk - ): Promise; -} - -export class ABCIApplicationClientImpl implements ABCIApplication { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Echo(request: RequestEcho): Promise { - const data = RequestEcho.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Echo", - data - ); - return promise.then((data) => ResponseEcho.decode(new Reader(data))); - } - - Flush(request: RequestFlush): Promise { - const data = RequestFlush.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Flush", - data - ); - return promise.then((data) => ResponseFlush.decode(new Reader(data))); - } - - Info(request: RequestInfo): Promise { - const data = RequestInfo.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Info", - data - ); - return promise.then((data) => ResponseInfo.decode(new Reader(data))); - } - - SetOption(request: RequestSetOption): Promise { - const data = RequestSetOption.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "SetOption", - data - ); - return promise.then((data) => ResponseSetOption.decode(new Reader(data))); - } - - DeliverTx(request: RequestDeliverTx): Promise { - const data = RequestDeliverTx.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "DeliverTx", - data - ); - return promise.then((data) => ResponseDeliverTx.decode(new Reader(data))); - } - - CheckTx(request: RequestCheckTx): Promise { - const data = RequestCheckTx.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "CheckTx", - data - ); - return promise.then((data) => ResponseCheckTx.decode(new Reader(data))); - } - - Query(request: RequestQuery): Promise { - const data = RequestQuery.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Query", - data - ); - return promise.then((data) => ResponseQuery.decode(new Reader(data))); - } - - Commit(request: RequestCommit): Promise { - const data = RequestCommit.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Commit", - data - ); - return promise.then((data) => ResponseCommit.decode(new Reader(data))); - } - - InitChain(request: RequestInitChain): Promise { - const data = RequestInitChain.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "InitChain", - data - ); - return promise.then((data) => ResponseInitChain.decode(new Reader(data))); - } - - BeginBlock(request: RequestBeginBlock): Promise { - const data = RequestBeginBlock.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "BeginBlock", - data - ); - return promise.then((data) => ResponseBeginBlock.decode(new Reader(data))); - } - - EndBlock(request: RequestEndBlock): Promise { - const data = RequestEndBlock.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "EndBlock", - data - ); - return promise.then((data) => ResponseEndBlock.decode(new Reader(data))); - } - - ListSnapshots(request: RequestListSnapshots): Promise { - const data = RequestListSnapshots.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "ListSnapshots", - data - ); - return promise.then((data) => - ResponseListSnapshots.decode(new Reader(data)) - ); - } - - OfferSnapshot(request: RequestOfferSnapshot): Promise { - const data = RequestOfferSnapshot.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "OfferSnapshot", - data - ); - return promise.then((data) => - ResponseOfferSnapshot.decode(new Reader(data)) - ); - } - - LoadSnapshotChunk( - request: RequestLoadSnapshotChunk - ): Promise { - const data = RequestLoadSnapshotChunk.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "LoadSnapshotChunk", - data - ); - return promise.then((data) => - ResponseLoadSnapshotChunk.decode(new Reader(data)) - ); - } - - ApplySnapshotChunk( - request: RequestApplySnapshotChunk - ): Promise { - const data = RequestApplySnapshotChunk.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "ApplySnapshotChunk", - data - ); - return promise.then((data) => - ResponseApplySnapshotChunk.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/crypto/keys.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/crypto/keys.ts deleted file mode 100644 index 450db2a1..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/crypto/keys.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.crypto"; - -/** PublicKey defines the keys available for use with Tendermint Validators */ -export interface PublicKey { - ed25519: Uint8Array | undefined; - secp256k1: Uint8Array | undefined; -} - -const basePublicKey: object = {}; - -export const PublicKey = { - encode(message: PublicKey, writer: Writer = Writer.create()): Writer { - if (message.ed25519 !== undefined) { - writer.uint32(10).bytes(message.ed25519); - } - if (message.secp256k1 !== undefined) { - writer.uint32(18).bytes(message.secp256k1); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PublicKey { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePublicKey } as PublicKey; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ed25519 = reader.bytes(); - break; - case 2: - message.secp256k1 = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = bytesFromBase64(object.ed25519); - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = bytesFromBase64(object.secp256k1); - } - return message; - }, - - toJSON(message: PublicKey): unknown { - const obj: any = {}; - message.ed25519 !== undefined && - (obj.ed25519 = - message.ed25519 !== undefined - ? base64FromBytes(message.ed25519) - : undefined); - message.secp256k1 !== undefined && - (obj.secp256k1 = - message.secp256k1 !== undefined - ? base64FromBytes(message.secp256k1) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = object.ed25519; - } else { - message.ed25519 = undefined; - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = object.secp256k1; - } else { - message.secp256k1 = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/crypto/proof.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/crypto/proof.ts deleted file mode 100644 index db058694..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/crypto/proof.ts +++ /dev/null @@ -1,529 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.crypto"; - -export interface Proof { - total: number; - index: number; - leaf_hash: Uint8Array; - aunts: Uint8Array[]; -} - -export interface ValueOp { - /** Encoded in ProofOp.Key. */ - key: Uint8Array; - /** To encode in ProofOp.Data */ - proof: Proof | undefined; -} - -export interface DominoOp { - key: string; - input: string; - output: string; -} - -/** - * ProofOp defines an operation used for calculating Merkle root - * The data could be arbitrary format, providing nessecary data - * for example neighbouring node hash - */ -export interface ProofOp { - type: string; - key: Uint8Array; - data: Uint8Array; -} - -/** ProofOps is Merkle proof defined by the list of ProofOps */ -export interface ProofOps { - ops: ProofOp[]; -} - -const baseProof: object = { total: 0, index: 0 }; - -export const Proof = { - encode(message: Proof, writer: Writer = Writer.create()): Writer { - if (message.total !== 0) { - writer.uint32(8).int64(message.total); - } - if (message.index !== 0) { - writer.uint32(16).int64(message.index); - } - if (message.leaf_hash.length !== 0) { - writer.uint32(26).bytes(message.leaf_hash); - } - for (const v of message.aunts) { - writer.uint32(34).bytes(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Proof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProof } as Proof; - message.aunts = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = longToNumber(reader.int64() as Long); - break; - case 2: - message.index = longToNumber(reader.int64() as Long); - break; - case 3: - message.leaf_hash = reader.bytes(); - break; - case 4: - message.aunts.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = bytesFromBase64(object.leaf_hash); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(bytesFromBase64(e)); - } - } - return message; - }, - - toJSON(message: Proof): unknown { - const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.index !== undefined && (obj.index = message.index); - message.leaf_hash !== undefined && - (obj.leaf_hash = base64FromBytes( - message.leaf_hash !== undefined ? message.leaf_hash : new Uint8Array() - )); - if (message.aunts) { - obj.aunts = message.aunts.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.aunts = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = object.leaf_hash; - } else { - message.leaf_hash = new Uint8Array(); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(e); - } - } - return message; - }, -}; - -const baseValueOp: object = {}; - -export const ValueOp = { - encode(message: ValueOp, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValueOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValueOp } as ValueOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.proof = Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; - }, - - toJSON(message: ValueOp): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } - return message; - }, -}; - -const baseDominoOp: object = { key: "", input: "", output: "" }; - -export const DominoOp = { - encode(message: DominoOp, writer: Writer = Writer.create()): Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.input !== "") { - writer.uint32(18).string(message.input); - } - if (message.output !== "") { - writer.uint32(26).string(message.output); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DominoOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDominoOp } as DominoOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.input = reader.string(); - break; - case 3: - message.output = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = String(object.input); - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = String(object.output); - } else { - message.output = ""; - } - return message; - }, - - toJSON(message: DominoOp): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.input !== undefined && (obj.input = message.input); - message.output !== undefined && (obj.output = message.output); - return obj; - }, - - fromPartial(object: DeepPartial): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = object.input; - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = object.output; - } else { - message.output = ""; - } - return message; - }, -}; - -const baseProofOp: object = { type: "" }; - -export const ProofOp = { - encode(message: ProofOp, writer: Writer = Writer.create()): Writer { - if (message.type !== "") { - writer.uint32(10).string(message.type); - } - if (message.key.length !== 0) { - writer.uint32(18).bytes(message.key); - } - if (message.data.length !== 0) { - writer.uint32(26).bytes(message.data); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOp } as ProofOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.key = reader.bytes(); - break; - case 3: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - toJSON(message: ProofOp): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = message.type); - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, -}; - -const baseProofOps: object = {}; - -export const ProofOps = { - encode(message: ProofOps, writer: Writer = Writer.create()): Writer { - for (const v of message.ops) { - ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ops.push(ProofOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ProofOps): unknown { - const obj: any = {}; - if (message.ops) { - obj.ops = message.ops.map((e) => (e ? ProofOp.toJSON(e) : undefined)); - } else { - obj.ops = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromPartial(e)); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/types/params.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/types/params.ts deleted file mode 100644 index d9b11da6..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/types/params.ts +++ /dev/null @@ -1,639 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Duration } from "../../google/protobuf/duration"; - -export const protobufPackage = "tendermint.types"; - -/** - * ConsensusParams contains consensus critical parameters that determine the - * validity of blocks. - */ -export interface ConsensusParams { - block: BlockParams | undefined; - evidence: EvidenceParams | undefined; - validator: ValidatorParams | undefined; - version: VersionParams | undefined; -} - -/** BlockParams contains limits on the block size. */ -export interface BlockParams { - /** - * Max block size, in bytes. - * Note: must be greater than 0 - */ - max_bytes: number; - /** - * Max gas per block. - * Note: must be greater or equal to -1 - */ - max_gas: number; - /** - * Minimum time increment between consecutive blocks (in milliseconds) If the - * block header timestamp is ahead of the system clock, decrease this value. - * - * Not exposed to the application. - */ - time_iota_ms: number; -} - -/** EvidenceParams determine how we handle evidence of malfeasance. */ -export interface EvidenceParams { - /** - * Max age of evidence, in blocks. - * - * The basic formula for calculating this is: MaxAgeDuration / {average block - * time}. - */ - max_age_num_blocks: number; - /** - * Max age of evidence, in time. - * - * It should correspond with an app's "unbonding period" or other similar - * mechanism for handling [Nothing-At-Stake - * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - */ - max_age_duration: Duration | undefined; - /** - * This sets the maximum size of total evidence in bytes that can be committed in a single block. - * and should fall comfortably under the max block bytes. - * Default is 1048576 or 1MB - */ - max_bytes: number; -} - -/** - * ValidatorParams restrict the public key types validators can use. - * NOTE: uses ABCI pubkey naming, not Amino names. - */ -export interface ValidatorParams { - pub_key_types: string[]; -} - -/** VersionParams contains the ABCI application version. */ -export interface VersionParams { - app_version: number; -} - -/** - * HashedParams is a subset of ConsensusParams. - * - * It is hashed into the Header.ConsensusHash. - */ -export interface HashedParams { - block_max_bytes: number; - block_max_gas: number; -} - -const baseConsensusParams: object = {}; - -export const ConsensusParams = { - encode(message: ConsensusParams, writer: Writer = Writer.create()): Writer { - if (message.block !== undefined) { - BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); - } - if (message.evidence !== undefined) { - EvidenceParams.encode( - message.evidence, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.validator !== undefined) { - ValidatorParams.encode( - message.validator, - writer.uint32(26).fork() - ).ldelim(); - } - if (message.version !== undefined) { - VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ConsensusParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensusParams } as ConsensusParams; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = BlockParams.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = EvidenceParams.decode(reader, reader.uint32()); - break; - case 3: - message.validator = ValidatorParams.decode(reader, reader.uint32()); - break; - case 4: - message.version = VersionParams.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConsensusParams { - const message = { ...baseConsensusParams } as ConsensusParams; - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromJSON(object.block); - } else { - message.block = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromJSON(object.validator); - } else { - message.validator = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromJSON(object.version); - } else { - message.version = undefined; - } - return message; - }, - - toJSON(message: ConsensusParams): unknown { - const obj: any = {}; - message.block !== undefined && - (obj.block = message.block - ? BlockParams.toJSON(message.block) - : undefined); - message.evidence !== undefined && - (obj.evidence = message.evidence - ? EvidenceParams.toJSON(message.evidence) - : undefined); - message.validator !== undefined && - (obj.validator = message.validator - ? ValidatorParams.toJSON(message.validator) - : undefined); - message.version !== undefined && - (obj.version = message.version - ? VersionParams.toJSON(message.version) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): ConsensusParams { - const message = { ...baseConsensusParams } as ConsensusParams; - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromPartial(object.block); - } else { - message.block = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromPartial(object.validator); - } else { - message.validator = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromPartial(object.version); - } else { - message.version = undefined; - } - return message; - }, -}; - -const baseBlockParams: object = { max_bytes: 0, max_gas: 0, time_iota_ms: 0 }; - -export const BlockParams = { - encode(message: BlockParams, writer: Writer = Writer.create()): Writer { - if (message.max_bytes !== 0) { - writer.uint32(8).int64(message.max_bytes); - } - if (message.max_gas !== 0) { - writer.uint32(16).int64(message.max_gas); - } - if (message.time_iota_ms !== 0) { - writer.uint32(24).int64(message.time_iota_ms); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BlockParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockParams } as BlockParams; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_bytes = longToNumber(reader.int64() as Long); - break; - case 2: - message.max_gas = longToNumber(reader.int64() as Long); - break; - case 3: - message.time_iota_ms = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BlockParams { - const message = { ...baseBlockParams } as BlockParams; - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = Number(object.max_bytes); - } else { - message.max_bytes = 0; - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.max_gas = Number(object.max_gas); - } else { - message.max_gas = 0; - } - if (object.time_iota_ms !== undefined && object.time_iota_ms !== null) { - message.time_iota_ms = Number(object.time_iota_ms); - } else { - message.time_iota_ms = 0; - } - return message; - }, - - toJSON(message: BlockParams): unknown { - const obj: any = {}; - message.max_bytes !== undefined && (obj.max_bytes = message.max_bytes); - message.max_gas !== undefined && (obj.max_gas = message.max_gas); - message.time_iota_ms !== undefined && - (obj.time_iota_ms = message.time_iota_ms); - return obj; - }, - - fromPartial(object: DeepPartial): BlockParams { - const message = { ...baseBlockParams } as BlockParams; - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = object.max_bytes; - } else { - message.max_bytes = 0; - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.max_gas = object.max_gas; - } else { - message.max_gas = 0; - } - if (object.time_iota_ms !== undefined && object.time_iota_ms !== null) { - message.time_iota_ms = object.time_iota_ms; - } else { - message.time_iota_ms = 0; - } - return message; - }, -}; - -const baseEvidenceParams: object = { max_age_num_blocks: 0, max_bytes: 0 }; - -export const EvidenceParams = { - encode(message: EvidenceParams, writer: Writer = Writer.create()): Writer { - if (message.max_age_num_blocks !== 0) { - writer.uint32(8).int64(message.max_age_num_blocks); - } - if (message.max_age_duration !== undefined) { - Duration.encode( - message.max_age_duration, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.max_bytes !== 0) { - writer.uint32(24).int64(message.max_bytes); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EvidenceParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidenceParams } as EvidenceParams; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_age_num_blocks = longToNumber(reader.int64() as Long); - break; - case 2: - message.max_age_duration = Duration.decode(reader, reader.uint32()); - break; - case 3: - message.max_bytes = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EvidenceParams { - const message = { ...baseEvidenceParams } as EvidenceParams; - if ( - object.max_age_num_blocks !== undefined && - object.max_age_num_blocks !== null - ) { - message.max_age_num_blocks = Number(object.max_age_num_blocks); - } else { - message.max_age_num_blocks = 0; - } - if ( - object.max_age_duration !== undefined && - object.max_age_duration !== null - ) { - message.max_age_duration = Duration.fromJSON(object.max_age_duration); - } else { - message.max_age_duration = undefined; - } - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = Number(object.max_bytes); - } else { - message.max_bytes = 0; - } - return message; - }, - - toJSON(message: EvidenceParams): unknown { - const obj: any = {}; - message.max_age_num_blocks !== undefined && - (obj.max_age_num_blocks = message.max_age_num_blocks); - message.max_age_duration !== undefined && - (obj.max_age_duration = message.max_age_duration - ? Duration.toJSON(message.max_age_duration) - : undefined); - message.max_bytes !== undefined && (obj.max_bytes = message.max_bytes); - return obj; - }, - - fromPartial(object: DeepPartial): EvidenceParams { - const message = { ...baseEvidenceParams } as EvidenceParams; - if ( - object.max_age_num_blocks !== undefined && - object.max_age_num_blocks !== null - ) { - message.max_age_num_blocks = object.max_age_num_blocks; - } else { - message.max_age_num_blocks = 0; - } - if ( - object.max_age_duration !== undefined && - object.max_age_duration !== null - ) { - message.max_age_duration = Duration.fromPartial(object.max_age_duration); - } else { - message.max_age_duration = undefined; - } - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = object.max_bytes; - } else { - message.max_bytes = 0; - } - return message; - }, -}; - -const baseValidatorParams: object = { pub_key_types: "" }; - -export const ValidatorParams = { - encode(message: ValidatorParams, writer: Writer = Writer.create()): Writer { - for (const v of message.pub_key_types) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorParams } as ValidatorParams; - message.pub_key_types = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pub_key_types.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorParams { - const message = { ...baseValidatorParams } as ValidatorParams; - message.pub_key_types = []; - if (object.pub_key_types !== undefined && object.pub_key_types !== null) { - for (const e of object.pub_key_types) { - message.pub_key_types.push(String(e)); - } - } - return message; - }, - - toJSON(message: ValidatorParams): unknown { - const obj: any = {}; - if (message.pub_key_types) { - obj.pub_key_types = message.pub_key_types.map((e) => e); - } else { - obj.pub_key_types = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ValidatorParams { - const message = { ...baseValidatorParams } as ValidatorParams; - message.pub_key_types = []; - if (object.pub_key_types !== undefined && object.pub_key_types !== null) { - for (const e of object.pub_key_types) { - message.pub_key_types.push(e); - } - } - return message; - }, -}; - -const baseVersionParams: object = { app_version: 0 }; - -export const VersionParams = { - encode(message: VersionParams, writer: Writer = Writer.create()): Writer { - if (message.app_version !== 0) { - writer.uint32(8).uint64(message.app_version); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): VersionParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVersionParams } as VersionParams; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.app_version = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): VersionParams { - const message = { ...baseVersionParams } as VersionParams; - if (object.app_version !== undefined && object.app_version !== null) { - message.app_version = Number(object.app_version); - } else { - message.app_version = 0; - } - return message; - }, - - toJSON(message: VersionParams): unknown { - const obj: any = {}; - message.app_version !== undefined && - (obj.app_version = message.app_version); - return obj; - }, - - fromPartial(object: DeepPartial): VersionParams { - const message = { ...baseVersionParams } as VersionParams; - if (object.app_version !== undefined && object.app_version !== null) { - message.app_version = object.app_version; - } else { - message.app_version = 0; - } - return message; - }, -}; - -const baseHashedParams: object = { block_max_bytes: 0, block_max_gas: 0 }; - -export const HashedParams = { - encode(message: HashedParams, writer: Writer = Writer.create()): Writer { - if (message.block_max_bytes !== 0) { - writer.uint32(8).int64(message.block_max_bytes); - } - if (message.block_max_gas !== 0) { - writer.uint32(16).int64(message.block_max_gas); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HashedParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHashedParams } as HashedParams; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_max_bytes = longToNumber(reader.int64() as Long); - break; - case 2: - message.block_max_gas = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HashedParams { - const message = { ...baseHashedParams } as HashedParams; - if ( - object.block_max_bytes !== undefined && - object.block_max_bytes !== null - ) { - message.block_max_bytes = Number(object.block_max_bytes); - } else { - message.block_max_bytes = 0; - } - if (object.block_max_gas !== undefined && object.block_max_gas !== null) { - message.block_max_gas = Number(object.block_max_gas); - } else { - message.block_max_gas = 0; - } - return message; - }, - - toJSON(message: HashedParams): unknown { - const obj: any = {}; - message.block_max_bytes !== undefined && - (obj.block_max_bytes = message.block_max_bytes); - message.block_max_gas !== undefined && - (obj.block_max_gas = message.block_max_gas); - return obj; - }, - - fromPartial(object: DeepPartial): HashedParams { - const message = { ...baseHashedParams } as HashedParams; - if ( - object.block_max_bytes !== undefined && - object.block_max_bytes !== null - ) { - message.block_max_bytes = object.block_max_bytes; - } else { - message.block_max_bytes = 0; - } - if (object.block_max_gas !== undefined && object.block_max_gas !== null) { - message.block_max_gas = object.block_max_gas; - } else { - message.block_max_gas = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/types/types.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/types/types.ts deleted file mode 100644 index 59a41a8e..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/types/types.ts +++ /dev/null @@ -1,1943 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Proof } from "../../tendermint/crypto/proof"; -import { Consensus } from "../../tendermint/version/types"; -import { ValidatorSet } from "../../tendermint/types/validator"; - -export const protobufPackage = "tendermint.types"; - -/** BlockIdFlag indicates which BlcokID the signature is for */ -export enum BlockIDFlag { - BLOCK_ID_FLAG_UNKNOWN = 0, - BLOCK_ID_FLAG_ABSENT = 1, - BLOCK_ID_FLAG_COMMIT = 2, - BLOCK_ID_FLAG_NIL = 3, - UNRECOGNIZED = -1, -} - -export function blockIDFlagFromJSON(object: any): BlockIDFlag { - switch (object) { - case 0: - case "BLOCK_ID_FLAG_UNKNOWN": - return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; - case 1: - case "BLOCK_ID_FLAG_ABSENT": - return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; - case 2: - case "BLOCK_ID_FLAG_COMMIT": - return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; - case 3: - case "BLOCK_ID_FLAG_NIL": - return BlockIDFlag.BLOCK_ID_FLAG_NIL; - case -1: - case "UNRECOGNIZED": - default: - return BlockIDFlag.UNRECOGNIZED; - } -} - -export function blockIDFlagToJSON(object: BlockIDFlag): string { - switch (object) { - case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: - return "BLOCK_ID_FLAG_UNKNOWN"; - case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: - return "BLOCK_ID_FLAG_ABSENT"; - case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: - return "BLOCK_ID_FLAG_COMMIT"; - case BlockIDFlag.BLOCK_ID_FLAG_NIL: - return "BLOCK_ID_FLAG_NIL"; - default: - return "UNKNOWN"; - } -} - -/** SignedMsgType is a type of signed message in the consensus. */ -export enum SignedMsgType { - SIGNED_MSG_TYPE_UNKNOWN = 0, - /** SIGNED_MSG_TYPE_PREVOTE - Votes */ - SIGNED_MSG_TYPE_PREVOTE = 1, - SIGNED_MSG_TYPE_PRECOMMIT = 2, - /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */ - SIGNED_MSG_TYPE_PROPOSAL = 32, - UNRECOGNIZED = -1, -} - -export function signedMsgTypeFromJSON(object: any): SignedMsgType { - switch (object) { - case 0: - case "SIGNED_MSG_TYPE_UNKNOWN": - return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN; - case 1: - case "SIGNED_MSG_TYPE_PREVOTE": - return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE; - case 2: - case "SIGNED_MSG_TYPE_PRECOMMIT": - return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT; - case 32: - case "SIGNED_MSG_TYPE_PROPOSAL": - return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL; - case -1: - case "UNRECOGNIZED": - default: - return SignedMsgType.UNRECOGNIZED; - } -} - -export function signedMsgTypeToJSON(object: SignedMsgType): string { - switch (object) { - case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: - return "SIGNED_MSG_TYPE_UNKNOWN"; - case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: - return "SIGNED_MSG_TYPE_PREVOTE"; - case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: - return "SIGNED_MSG_TYPE_PRECOMMIT"; - case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: - return "SIGNED_MSG_TYPE_PROPOSAL"; - default: - return "UNKNOWN"; - } -} - -/** PartsetHeader */ -export interface PartSetHeader { - total: number; - hash: Uint8Array; -} - -export interface Part { - index: number; - bytes: Uint8Array; - proof: Proof | undefined; -} - -/** BlockID */ -export interface BlockID { - hash: Uint8Array; - part_set_header: PartSetHeader | undefined; -} - -/** Header defines the structure of a Tendermint block header. */ -export interface Header { - /** basic block info */ - version: Consensus | undefined; - chain_id: string; - height: number; - time: Date | undefined; - /** prev block info */ - last_block_id: BlockID | undefined; - /** hashes of block data */ - last_commit_hash: Uint8Array; - /** transactions */ - data_hash: Uint8Array; - /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; - /** validators for the next block */ - next_validators_hash: Uint8Array; - /** consensus params for current block */ - consensus_hash: Uint8Array; - /** state after txs from the previous block */ - app_hash: Uint8Array; - /** root hash of all results from the txs from the previous block */ - last_results_hash: Uint8Array; - /** consensus info */ - evidence_hash: Uint8Array; - /** original proposer of the block */ - proposer_address: Uint8Array; -} - -/** Data contains the set of transactions included in the block */ -export interface Data { - /** - * Txs that will be applied by state @ block.Height+1. - * NOTE: not all txs here are valid. We're just agreeing on the order first. - * This means that block.AppHash does not include these txs. - */ - txs: Uint8Array[]; -} - -/** - * Vote represents a prevote, precommit, or commit vote from validators for - * consensus. - */ -export interface Vote { - type: SignedMsgType; - height: number; - round: number; - /** zero if vote is nil. */ - block_id: BlockID | undefined; - timestamp: Date | undefined; - validator_address: Uint8Array; - validator_index: number; - signature: Uint8Array; -} - -/** Commit contains the evidence that a block was committed by a set of validators. */ -export interface Commit { - height: number; - round: number; - block_id: BlockID | undefined; - signatures: CommitSig[]; -} - -/** CommitSig is a part of the Vote included in a Commit. */ -export interface CommitSig { - block_id_flag: BlockIDFlag; - validator_address: Uint8Array; - timestamp: Date | undefined; - signature: Uint8Array; -} - -export interface Proposal { - type: SignedMsgType; - height: number; - round: number; - pol_round: number; - block_id: BlockID | undefined; - timestamp: Date | undefined; - signature: Uint8Array; -} - -export interface SignedHeader { - header: Header | undefined; - commit: Commit | undefined; -} - -export interface LightBlock { - signed_header: SignedHeader | undefined; - validator_set: ValidatorSet | undefined; -} - -export interface BlockMeta { - block_id: BlockID | undefined; - block_size: number; - header: Header | undefined; - num_txs: number; -} - -/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ -export interface TxProof { - root_hash: Uint8Array; - data: Uint8Array; - proof: Proof | undefined; -} - -const basePartSetHeader: object = { total: 0 }; - -export const PartSetHeader = { - encode(message: PartSetHeader, writer: Writer = Writer.create()): Writer { - if (message.total !== 0) { - writer.uint32(8).uint32(message.total); - } - if (message.hash.length !== 0) { - writer.uint32(18).bytes(message.hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PartSetHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePartSetHeader } as PartSetHeader; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = reader.uint32(); - break; - case 2: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; - }, - - toJSON(message: PartSetHeader): unknown { - const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - return message; - }, -}; - -const basePart: object = { index: 0 }; - -export const Part = { - encode(message: Part, writer: Writer = Writer.create()): Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - if (message.bytes.length !== 0) { - writer.uint32(18).bytes(message.bytes); - } - if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Part { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePart } as Part; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.bytes = reader.bytes(); - break; - case 3: - message.proof = Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = bytesFromBase64(object.bytes); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; - }, - - toJSON(message: Part): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.bytes !== undefined && - (obj.bytes = base64FromBytes( - message.bytes !== undefined ? message.bytes : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = object.bytes; - } else { - message.bytes = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } - return message; - }, -}; - -const baseBlockID: object = {}; - -export const BlockID = { - encode(message: BlockID, writer: Writer = Writer.create()): Writer { - if (message.hash.length !== 0) { - writer.uint32(10).bytes(message.hash); - } - if (message.part_set_header !== undefined) { - PartSetHeader.encode( - message.part_set_header, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BlockID { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockID } as BlockID; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - case 2: - message.part_set_header = PartSetHeader.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromJSON(object.part_set_header); - } else { - message.part_set_header = undefined; - } - return message; - }, - - toJSON(message: BlockID): unknown { - const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.part_set_header !== undefined && - (obj.part_set_header = message.part_set_header - ? PartSetHeader.toJSON(message.part_set_header) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromPartial( - object.part_set_header - ); - } else { - message.part_set_header = undefined; - } - return message; - }, -}; - -const baseHeader: object = { chain_id: "", height: 0 }; - -export const Header = { - encode(message: Header, writer: Writer = Writer.create()): Writer { - if (message.version !== undefined) { - Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); - } - if (message.chain_id !== "") { - writer.uint32(18).string(message.chain_id); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(34).fork() - ).ldelim(); - } - if (message.last_block_id !== undefined) { - BlockID.encode(message.last_block_id, writer.uint32(42).fork()).ldelim(); - } - if (message.last_commit_hash.length !== 0) { - writer.uint32(50).bytes(message.last_commit_hash); - } - if (message.data_hash.length !== 0) { - writer.uint32(58).bytes(message.data_hash); - } - if (message.validators_hash.length !== 0) { - writer.uint32(66).bytes(message.validators_hash); - } - if (message.next_validators_hash.length !== 0) { - writer.uint32(74).bytes(message.next_validators_hash); - } - if (message.consensus_hash.length !== 0) { - writer.uint32(82).bytes(message.consensus_hash); - } - if (message.app_hash.length !== 0) { - writer.uint32(90).bytes(message.app_hash); - } - if (message.last_results_hash.length !== 0) { - writer.uint32(98).bytes(message.last_results_hash); - } - if (message.evidence_hash.length !== 0) { - writer.uint32(106).bytes(message.evidence_hash); - } - if (message.proposer_address.length !== 0) { - writer.uint32(114).bytes(message.proposer_address); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Header { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeader } as Header; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = Consensus.decode(reader, reader.uint32()); - break; - case 2: - message.chain_id = reader.string(); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 5: - message.last_block_id = BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.last_commit_hash = reader.bytes(); - break; - case 7: - message.data_hash = reader.bytes(); - break; - case 8: - message.validators_hash = reader.bytes(); - break; - case 9: - message.next_validators_hash = reader.bytes(); - break; - case 10: - message.consensus_hash = reader.bytes(); - break; - case 11: - message.app_hash = reader.bytes(); - break; - case 12: - message.last_results_hash = reader.bytes(); - break; - case 13: - message.evidence_hash = reader.bytes(); - break; - case 14: - message.proposer_address = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromJSON(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromJSON(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = bytesFromBase64(object.last_commit_hash); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = bytesFromBase64(object.data_hash); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = bytesFromBase64(object.validators_hash); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = bytesFromBase64( - object.next_validators_hash - ); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = bytesFromBase64(object.consensus_hash); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = bytesFromBase64(object.last_results_hash); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = bytesFromBase64(object.evidence_hash); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = bytesFromBase64(object.proposer_address); - } - return message; - }, - - toJSON(message: Header): unknown { - const obj: any = {}; - message.version !== undefined && - (obj.version = message.version - ? Consensus.toJSON(message.version) - : undefined); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.last_block_id !== undefined && - (obj.last_block_id = message.last_block_id - ? BlockID.toJSON(message.last_block_id) - : undefined); - message.last_commit_hash !== undefined && - (obj.last_commit_hash = base64FromBytes( - message.last_commit_hash !== undefined - ? message.last_commit_hash - : new Uint8Array() - )); - message.data_hash !== undefined && - (obj.data_hash = base64FromBytes( - message.data_hash !== undefined ? message.data_hash : new Uint8Array() - )); - message.validators_hash !== undefined && - (obj.validators_hash = base64FromBytes( - message.validators_hash !== undefined - ? message.validators_hash - : new Uint8Array() - )); - message.next_validators_hash !== undefined && - (obj.next_validators_hash = base64FromBytes( - message.next_validators_hash !== undefined - ? message.next_validators_hash - : new Uint8Array() - )); - message.consensus_hash !== undefined && - (obj.consensus_hash = base64FromBytes( - message.consensus_hash !== undefined - ? message.consensus_hash - : new Uint8Array() - )); - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() - )); - message.last_results_hash !== undefined && - (obj.last_results_hash = base64FromBytes( - message.last_results_hash !== undefined - ? message.last_results_hash - : new Uint8Array() - )); - message.evidence_hash !== undefined && - (obj.evidence_hash = base64FromBytes( - message.evidence_hash !== undefined - ? message.evidence_hash - : new Uint8Array() - )); - message.proposer_address !== undefined && - (obj.proposer_address = base64FromBytes( - message.proposer_address !== undefined - ? message.proposer_address - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial
): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromPartial(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromPartial(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = object.last_commit_hash; - } else { - message.last_commit_hash = new Uint8Array(); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = object.data_hash; - } else { - message.data_hash = new Uint8Array(); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = object.validators_hash; - } else { - message.validators_hash = new Uint8Array(); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = object.next_validators_hash; - } else { - message.next_validators_hash = new Uint8Array(); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = object.consensus_hash; - } else { - message.consensus_hash = new Uint8Array(); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = object.last_results_hash; - } else { - message.last_results_hash = new Uint8Array(); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = object.evidence_hash; - } else { - message.evidence_hash = new Uint8Array(); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = object.proposer_address; - } else { - message.proposer_address = new Uint8Array(); - } - return message; - }, -}; - -const baseData: object = {}; - -export const Data = { - encode(message: Data, writer: Writer = Writer.create()): Writer { - for (const v of message.txs) { - writer.uint32(10).bytes(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Data { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseData } as Data; - message.txs = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.txs.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(bytesFromBase64(e)); - } - } - return message; - }, - - toJSON(message: Data): unknown { - const obj: any = {}; - if (message.txs) { - obj.txs = message.txs.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.txs = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(e); - } - } - return message; - }, -}; - -const baseVote: object = { type: 0, height: 0, round: 0, validator_index: 0 }; - -export const Vote = { - encode(message: Vote, writer: Writer = Writer.create()): Writer { - if (message.type !== 0) { - writer.uint32(8).int32(message.type); - } - if (message.height !== 0) { - writer.uint32(16).int64(message.height); - } - if (message.round !== 0) { - writer.uint32(24).int32(message.round); - } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(34).fork()).ldelim(); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); - } - if (message.validator_address.length !== 0) { - writer.uint32(50).bytes(message.validator_address); - } - if (message.validator_index !== 0) { - writer.uint32(56).int32(message.validator_index); - } - if (message.signature.length !== 0) { - writer.uint32(66).bytes(message.signature); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVote } as Vote; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32() as any; - break; - case 2: - message.height = longToNumber(reader.int64() as Long); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 6: - message.validator_address = reader.bytes(); - break; - case 7: - message.validator_index = reader.int32(); - break; - case 8: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = Number(object.validator_index); - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: Vote): unknown { - const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.validator_index !== undefined && - (obj.validator_index = message.validator_index); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = object.validator_index; - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseCommit: object = { height: 0, round: 0 }; - -export const Commit = { - encode(message: Commit, writer: Writer = Writer.create()): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - if (message.round !== 0) { - writer.uint32(16).int32(message.round); - } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.signatures) { - CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Commit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommit } as Commit; - message.signatures = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - case 2: - message.round = reader.int32(); - break; - case 3: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 4: - message.signatures.push(CommitSig.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Commit): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? CommitSig.toJSON(e) : undefined - ); - } else { - obj.signatures = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCommitSig: object = { block_id_flag: 0 }; - -export const CommitSig = { - encode(message: CommitSig, writer: Writer = Writer.create()): Writer { - if (message.block_id_flag !== 0) { - writer.uint32(8).int32(message.block_id_flag); - } - if (message.validator_address.length !== 0) { - writer.uint32(18).bytes(message.validator_address); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(26).fork() - ).ldelim(); - } - if (message.signature.length !== 0) { - writer.uint32(34).bytes(message.signature); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CommitSig { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommitSig } as CommitSig; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id_flag = reader.int32() as any; - break; - case 2: - message.validator_address = reader.bytes(); - break; - case 3: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 4: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = blockIDFlagFromJSON(object.block_id_flag); - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: CommitSig): unknown { - const obj: any = {}; - message.block_id_flag !== undefined && - (obj.block_id_flag = blockIDFlagToJSON(message.block_id_flag)); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = object.block_id_flag; - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseProposal: object = { type: 0, height: 0, round: 0, pol_round: 0 }; - -export const Proposal = { - encode(message: Proposal, writer: Writer = Writer.create()): Writer { - if (message.type !== 0) { - writer.uint32(8).int32(message.type); - } - if (message.height !== 0) { - writer.uint32(16).int64(message.height); - } - if (message.round !== 0) { - writer.uint32(24).int32(message.round); - } - if (message.pol_round !== 0) { - writer.uint32(32).int32(message.pol_round); - } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(42).fork()).ldelim(); - } - if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(50).fork() - ).ldelim(); - } - if (message.signature.length !== 0) { - writer.uint32(58).bytes(message.signature); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProposal } as Proposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32() as any; - break; - case 2: - message.height = longToNumber(reader.int64() as Long); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.pol_round = reader.int32(); - break; - case 5: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 7: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = Number(object.pol_round); - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: Proposal): unknown { - const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.pol_round !== undefined && (obj.pol_round = message.pol_round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = object.pol_round; - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseSignedHeader: object = {}; - -export const SignedHeader = { - encode(message: SignedHeader, writer: Writer = Writer.create()): Writer { - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(10).fork()).ldelim(); - } - if (message.commit !== undefined) { - Commit.encode(message.commit, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SignedHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignedHeader } as SignedHeader; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = Header.decode(reader, reader.uint32()); - break; - case 2: - message.commit = Commit.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - return message; - }, - - toJSON(message: SignedHeader): unknown { - const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.commit !== undefined && - (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromPartial(object.commit); - } else { - message.commit = undefined; - } - return message; - }, -}; - -const baseLightBlock: object = {}; - -export const LightBlock = { - encode(message: LightBlock, writer: Writer = Writer.create()): Writer { - if (message.signed_header !== undefined) { - SignedHeader.encode( - message.signed_header, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.validator_set !== undefined) { - ValidatorSet.encode( - message.validator_set, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): LightBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLightBlock } as LightBlock; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signed_header = SignedHeader.decode(reader, reader.uint32()); - break; - case 2: - message.validator_set = ValidatorSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromJSON(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromJSON(object.validator_set); - } else { - message.validator_set = undefined; - } - return message; - }, - - toJSON(message: LightBlock): unknown { - const obj: any = {}; - message.signed_header !== undefined && - (obj.signed_header = message.signed_header - ? SignedHeader.toJSON(message.signed_header) - : undefined); - message.validator_set !== undefined && - (obj.validator_set = message.validator_set - ? ValidatorSet.toJSON(message.validator_set) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromPartial(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromPartial(object.validator_set); - } else { - message.validator_set = undefined; - } - return message; - }, -}; - -const baseBlockMeta: object = { block_size: 0, num_txs: 0 }; - -export const BlockMeta = { - encode(message: BlockMeta, writer: Writer = Writer.create()): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); - } - if (message.block_size !== 0) { - writer.uint32(16).int64(message.block_size); - } - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(26).fork()).ldelim(); - } - if (message.num_txs !== 0) { - writer.uint32(32).int64(message.num_txs); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BlockMeta { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockMeta } as BlockMeta; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); - break; - case 2: - message.block_size = longToNumber(reader.int64() as Long); - break; - case 3: - message.header = Header.decode(reader, reader.uint32()); - break; - case 4: - message.num_txs = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = Number(object.block_size); - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = Number(object.num_txs); - } else { - message.num_txs = 0; - } - return message; - }, - - toJSON(message: BlockMeta): unknown { - const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block_size !== undefined && (obj.block_size = message.block_size); - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.num_txs !== undefined && (obj.num_txs = message.num_txs); - return obj; - }, - - fromPartial(object: DeepPartial): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = object.block_size; - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = object.num_txs; - } else { - message.num_txs = 0; - } - return message; - }, -}; - -const baseTxProof: object = {}; - -export const TxProof = { - encode(message: TxProof, writer: Writer = Writer.create()): Writer { - if (message.root_hash.length !== 0) { - writer.uint32(10).bytes(message.root_hash); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): TxProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxProof } as TxProof; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.root_hash = reader.bytes(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.proof = Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = bytesFromBase64(object.root_hash); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; - }, - - toJSON(message: TxProof): unknown { - const obj: any = {}; - message.root_hash !== undefined && - (obj.root_hash = base64FromBytes( - message.root_hash !== undefined ? message.root_hash : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = object.root_hash; - } else { - message.root_hash = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/types/validator.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/types/validator.ts deleted file mode 100644 index 8c3581c1..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/types/validator.ts +++ /dev/null @@ -1,382 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { PublicKey } from "../../tendermint/crypto/keys"; - -export const protobufPackage = "tendermint.types"; - -export interface ValidatorSet { - validators: Validator[]; - proposer: Validator | undefined; - total_voting_power: number; -} - -export interface Validator { - address: Uint8Array; - pub_key: PublicKey | undefined; - voting_power: number; - proposer_priority: number; -} - -export interface SimpleValidator { - pub_key: PublicKey | undefined; - voting_power: number; -} - -const baseValidatorSet: object = { total_voting_power: 0 }; - -export const ValidatorSet = { - encode(message: ValidatorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.validators) { - Validator.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.proposer !== undefined) { - Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); - } - if (message.total_voting_power !== 0) { - writer.uint32(24).int64(message.total_voting_power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; - case 2: - message.proposer = Validator.decode(reader, reader.uint32()); - break; - case 3: - message.total_voting_power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromJSON(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - return message; - }, - - toJSON(message: ValidatorSet): unknown { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.proposer !== undefined && - (obj.proposer = message.proposer - ? Validator.toJSON(message.proposer) - : undefined); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - return obj; - }, - - fromPartial(object: DeepPartial): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromPartial(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - return message; - }, -}; - -const baseValidator: object = { voting_power: 0, proposer_priority: 0 }; - -export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { - if (message.address.length !== 0) { - writer.uint32(10).bytes(message.address); - } - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); - } - if (message.voting_power !== 0) { - writer.uint32(24).int64(message.voting_power); - } - if (message.proposer_priority !== 0) { - writer.uint32(32).int64(message.proposer_priority); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.bytes(); - break; - case 2: - message.pub_key = PublicKey.decode(reader, reader.uint32()); - break; - case 3: - message.voting_power = longToNumber(reader.int64() as Long); - break; - case 4: - message.proposer_priority = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = Number(object.proposer_priority); - } else { - message.proposer_priority = 0; - } - return message; - }, - - toJSON(message: Validator): unknown { - const obj: any = {}; - message.address !== undefined && - (obj.address = base64FromBytes( - message.address !== undefined ? message.address : new Uint8Array() - )); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - message.proposer_priority !== undefined && - (obj.proposer_priority = message.proposer_priority); - return obj; - }, - - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = new Uint8Array(); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = object.proposer_priority; - } else { - message.proposer_priority = 0; - } - return message; - }, -}; - -const baseSimpleValidator: object = { voting_power: 0 }; - -export const SimpleValidator = { - encode(message: SimpleValidator, writer: Writer = Writer.create()): Writer { - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(10).fork()).ldelim(); - } - if (message.voting_power !== 0) { - writer.uint32(16).int64(message.voting_power); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SimpleValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimpleValidator } as SimpleValidator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pub_key = PublicKey.decode(reader, reader.uint32()); - break; - case 2: - message.voting_power = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - return message; - }, - - toJSON(message: SimpleValidator): unknown { - const obj: any = {}; - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - return obj; - }, - - fromPartial(object: DeepPartial): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/version/types.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/version/types.ts deleted file mode 100644 index 4bc6ad82..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/module/types/tendermint/version/types.ts +++ /dev/null @@ -1,202 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "tendermint.version"; - -/** - * App includes the protocol and software version for the application. - * This information is included in ResponseInfo. The App.Protocol can be - * updated in ResponseEndBlock. - */ -export interface App { - protocol: number; - software: string; -} - -/** - * Consensus captures the consensus rules for processing a block in the blockchain, - * including all blockchain data structures and the rules of the application's - * state transition machine. - */ -export interface Consensus { - block: number; - app: number; -} - -const baseApp: object = { protocol: 0, software: "" }; - -export const App = { - encode(message: App, writer: Writer = Writer.create()): Writer { - if (message.protocol !== 0) { - writer.uint32(8).uint64(message.protocol); - } - if (message.software !== "") { - writer.uint32(18).string(message.software); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): App { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseApp } as App; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.protocol = longToNumber(reader.uint64() as Long); - break; - case 2: - message.software = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = Number(object.protocol); - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = String(object.software); - } else { - message.software = ""; - } - return message; - }, - - toJSON(message: App): unknown { - const obj: any = {}; - message.protocol !== undefined && (obj.protocol = message.protocol); - message.software !== undefined && (obj.software = message.software); - return obj; - }, - - fromPartial(object: DeepPartial): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = object.protocol; - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = object.software; - } else { - message.software = ""; - } - return message; - }, -}; - -const baseConsensus: object = { block: 0, app: 0 }; - -export const Consensus = { - encode(message: Consensus, writer: Writer = Writer.create()): Writer { - if (message.block !== 0) { - writer.uint32(8).uint64(message.block); - } - if (message.app !== 0) { - writer.uint32(16).uint64(message.app); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Consensus { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensus } as Consensus; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = longToNumber(reader.uint64() as Long); - break; - case 2: - message.app = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = Number(object.block); - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = Number(object.app); - } else { - message.app = 0; - } - return message; - }, - - toJSON(message: Consensus): unknown { - const obj: any = {}; - message.block !== undefined && (obj.block = message.block); - message.app !== undefined && (obj.app = message.app); - return obj; - }, - - fromPartial(object: DeepPartial): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = object.block; - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = object.app; - } else { - message.app = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/package.json deleted file mode 100644 index 7c2c0779..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-tx-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.tx.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/types/tx", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.tx.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/index.ts deleted file mode 100644 index 15068df8..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/index.ts +++ /dev/null @@ -1,238 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { Plan } from "./module/types/cosmos/upgrade/v1beta1/upgrade" -import { SoftwareUpgradeProposal } from "./module/types/cosmos/upgrade/v1beta1/upgrade" -import { CancelSoftwareUpgradeProposal } from "./module/types/cosmos/upgrade/v1beta1/upgrade" -import { ModuleVersion } from "./module/types/cosmos/upgrade/v1beta1/upgrade" - - -export { Plan, SoftwareUpgradeProposal, CancelSoftwareUpgradeProposal, ModuleVersion }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - CurrentPlan: {}, - AppliedPlan: {}, - UpgradedConsensusState: {}, - ModuleVersions: {}, - - _Structure: { - Plan: getStructure(Plan.fromPartial({})), - SoftwareUpgradeProposal: getStructure(SoftwareUpgradeProposal.fromPartial({})), - CancelSoftwareUpgradeProposal: getStructure(CancelSoftwareUpgradeProposal.fromPartial({})), - ModuleVersion: getStructure(ModuleVersion.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getCurrentPlan: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.CurrentPlan[JSON.stringify(params)] ?? {} - }, - getAppliedPlan: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AppliedPlan[JSON.stringify(params)] ?? {} - }, - getUpgradedConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UpgradedConsensusState[JSON.stringify(params)] ?? {} - }, - getModuleVersions: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ModuleVersions[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.upgrade.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryCurrentPlan({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryCurrentPlan()).data - - - commit('QUERY', { query: 'CurrentPlan', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryCurrentPlan', payload: { options: { all }, params: {...key},query }}) - return getters['getCurrentPlan']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryCurrentPlan API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAppliedPlan({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryAppliedPlan( key.name)).data - - - commit('QUERY', { query: 'AppliedPlan', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAppliedPlan', payload: { options: { all }, params: {...key},query }}) - return getters['getAppliedPlan']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAppliedPlan API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUpgradedConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryUpgradedConsensusState( key.last_height)).data - - - commit('QUERY', { query: 'UpgradedConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUpgradedConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getUpgradedConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUpgradedConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryModuleVersions({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryModuleVersions(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryModuleVersions({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ModuleVersions', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryModuleVersions', payload: { options: { all }, params: {...key},query }}) - return getters['getModuleVersions']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryModuleVersions API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/rest.ts deleted file mode 100644 index 9af9f252..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/rest.ts +++ /dev/null @@ -1,493 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* ModuleVersion specifies a module and its consensus version. - -Since: cosmos-sdk 0.43 -*/ -export interface V1Beta1ModuleVersion { - name?: string; - - /** @format uint64 */ - version?: string; -} - -/** - * Plan specifies information about a planned upgrade and when it should occur. - */ -export interface V1Beta1Plan { - /** - * Sets the name for the upgrade. This name will be used by the upgraded - * version of the software to apply any special "on-upgrade" commands during - * the first BeginBlock method after the upgrade is applied. It is also used - * to detect whether a software version can handle a given upgrade. If no - * upgrade handler with this name has been set in the software, it will be - * assumed that the software is out-of-date when the upgrade Time or Height is - * reached and the software will exit. - */ - name?: string; - - /** - * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic - * has been removed from the SDK. - * If this field is not empty, an error will be thrown. - * @format date-time - */ - time?: string; - - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - * @format int64 - */ - height?: string; - info?: string; - - /** - * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been - * moved to the IBC module in the sub module 02-client. - * If this field is not empty, an error will be thrown. - */ - upgraded_client_state?: ProtobufAny; -} - -/** -* QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC -method. -*/ -export interface V1Beta1QueryAppliedPlanResponse { - /** - * height is the block height at which the plan was applied. - * @format int64 - */ - height?: string; -} - -/** -* QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC -method. -*/ -export interface V1Beta1QueryCurrentPlanResponse { - /** plan is the current upgrade plan. */ - plan?: V1Beta1Plan; -} - -/** -* QueryModuleVersionsResponse is the response type for the Query/ModuleVersions -RPC method. - -Since: cosmos-sdk 0.43 -*/ -export interface V1Beta1QueryModuleVersionsResponse { - /** module_versions is a list of module names with their consensus versions. */ - module_versions?: V1Beta1ModuleVersion[]; -} - -/** -* QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState -RPC method. -*/ -export interface V1Beta1QueryUpgradedConsensusStateResponse { - /** @format byte */ - upgraded_consensus_state?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/upgrade/v1beta1/query.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryAppliedPlan - * @summary AppliedPlan queries a previously applied upgrade plan by its name. - * @request GET:/cosmos/upgrade/v1beta1/applied_plan/{name} - */ - queryAppliedPlan = (name: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/upgrade/v1beta1/applied_plan/${name}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryCurrentPlan - * @summary CurrentPlan queries the current upgrade plan. - * @request GET:/cosmos/upgrade/v1beta1/current_plan - */ - queryCurrentPlan = (params: RequestParams = {}) => - this.request({ - path: `/cosmos/upgrade/v1beta1/current_plan`, - method: "GET", - format: "json", - ...params, - }); - - /** - * @description Since: cosmos-sdk 0.43 - * - * @tags Query - * @name QueryModuleVersions - * @summary ModuleVersions queries the list of module versions from state. - * @request GET:/cosmos/upgrade/v1beta1/module_versions - */ - queryModuleVersions = (query?: { module_name?: string }, params: RequestParams = {}) => - this.request({ - path: `/cosmos/upgrade/v1beta1/module_versions`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryUpgradedConsensusState - * @summary UpgradedConsensusState queries the consensus state that will serve -as a trusted kernel for the next version of this chain. It will only be -stored at the last height of this chain. -UpgradedConsensusState RPC not supported with legacy querier -This rpc is deprecated now that IBC has its own replacement -(https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - * @request GET:/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height} - */ - queryUpgradedConsensusState = (last_height: string, params: RequestParams = {}) => - this.request({ - path: `/cosmos/upgrade/v1beta1/upgraded_consensus_state/${last_height}`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/cosmos/upgrade/v1beta1/query.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/cosmos/upgrade/v1beta1/query.ts deleted file mode 100644 index 389719f1..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/cosmos/upgrade/v1beta1/query.ts +++ /dev/null @@ -1,806 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { Plan, ModuleVersion } from "../../../cosmos/upgrade/v1beta1/upgrade"; - -export const protobufPackage = "cosmos.upgrade.v1beta1"; - -/** - * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC - * method. - */ -export interface QueryCurrentPlanRequest {} - -/** - * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC - * method. - */ -export interface QueryCurrentPlanResponse { - /** plan is the current upgrade plan. */ - plan: Plan | undefined; -} - -/** - * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC - * method. - */ -export interface QueryAppliedPlanRequest { - /** name is the name of the applied plan to query for. */ - name: string; -} - -/** - * QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC - * method. - */ -export interface QueryAppliedPlanResponse { - /** height is the block height at which the plan was applied. */ - height: number; -} - -/** - * QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState - * RPC method. - * - * @deprecated - */ -export interface QueryUpgradedConsensusStateRequest { - /** - * last height of the current chain must be sent in request - * as this is the height under which next consensus state is stored - */ - last_height: number; -} - -/** - * QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState - * RPC method. - * - * @deprecated - */ -export interface QueryUpgradedConsensusStateResponse { - /** Since: cosmos-sdk 0.43 */ - upgraded_consensus_state: Uint8Array; -} - -/** - * QueryModuleVersionsRequest is the request type for the Query/ModuleVersions - * RPC method. - * - * Since: cosmos-sdk 0.43 - */ -export interface QueryModuleVersionsRequest { - /** - * module_name is a field to query a specific module - * consensus version from state. Leaving this empty will - * fetch the full list of module versions from state - */ - module_name: string; -} - -/** - * QueryModuleVersionsResponse is the response type for the Query/ModuleVersions - * RPC method. - * - * Since: cosmos-sdk 0.43 - */ -export interface QueryModuleVersionsResponse { - /** module_versions is a list of module names with their consensus versions. */ - module_versions: ModuleVersion[]; -} - -const baseQueryCurrentPlanRequest: object = {}; - -export const QueryCurrentPlanRequest = { - encode(_: QueryCurrentPlanRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryCurrentPlanRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryCurrentPlanRequest, - } as QueryCurrentPlanRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryCurrentPlanRequest { - const message = { - ...baseQueryCurrentPlanRequest, - } as QueryCurrentPlanRequest; - return message; - }, - - toJSON(_: QueryCurrentPlanRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): QueryCurrentPlanRequest { - const message = { - ...baseQueryCurrentPlanRequest, - } as QueryCurrentPlanRequest; - return message; - }, -}; - -const baseQueryCurrentPlanResponse: object = {}; - -export const QueryCurrentPlanResponse = { - encode( - message: QueryCurrentPlanResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryCurrentPlanResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryCurrentPlanResponse, - } as QueryCurrentPlanResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.plan = Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryCurrentPlanResponse { - const message = { - ...baseQueryCurrentPlanResponse, - } as QueryCurrentPlanResponse; - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - return message; - }, - - toJSON(message: QueryCurrentPlanResponse): unknown { - const obj: any = {}; - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryCurrentPlanResponse { - const message = { - ...baseQueryCurrentPlanResponse, - } as QueryCurrentPlanResponse; - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - return message; - }, -}; - -const baseQueryAppliedPlanRequest: object = { name: "" }; - -export const QueryAppliedPlanRequest = { - encode( - message: QueryAppliedPlanRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAppliedPlanRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAppliedPlanRequest, - } as QueryAppliedPlanRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAppliedPlanRequest { - const message = { - ...baseQueryAppliedPlanRequest, - } as QueryAppliedPlanRequest; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - return message; - }, - - toJSON(message: QueryAppliedPlanRequest): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAppliedPlanRequest { - const message = { - ...baseQueryAppliedPlanRequest, - } as QueryAppliedPlanRequest; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - return message; - }, -}; - -const baseQueryAppliedPlanResponse: object = { height: 0 }; - -export const QueryAppliedPlanResponse = { - encode( - message: QueryAppliedPlanResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== 0) { - writer.uint32(8).int64(message.height); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAppliedPlanResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAppliedPlanResponse, - } as QueryAppliedPlanResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAppliedPlanResponse { - const message = { - ...baseQueryAppliedPlanResponse, - } as QueryAppliedPlanResponse; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; - }, - - toJSON(message: QueryAppliedPlanResponse): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAppliedPlanResponse { - const message = { - ...baseQueryAppliedPlanResponse, - } as QueryAppliedPlanResponse; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - return message; - }, -}; - -const baseQueryUpgradedConsensusStateRequest: object = { last_height: 0 }; - -export const QueryUpgradedConsensusStateRequest = { - encode( - message: QueryUpgradedConsensusStateRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.last_height !== 0) { - writer.uint32(8).int64(message.last_height); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUpgradedConsensusStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUpgradedConsensusStateRequest, - } as QueryUpgradedConsensusStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.last_height = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUpgradedConsensusStateRequest { - const message = { - ...baseQueryUpgradedConsensusStateRequest, - } as QueryUpgradedConsensusStateRequest; - if (object.last_height !== undefined && object.last_height !== null) { - message.last_height = Number(object.last_height); - } else { - message.last_height = 0; - } - return message; - }, - - toJSON(message: QueryUpgradedConsensusStateRequest): unknown { - const obj: any = {}; - message.last_height !== undefined && - (obj.last_height = message.last_height); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUpgradedConsensusStateRequest { - const message = { - ...baseQueryUpgradedConsensusStateRequest, - } as QueryUpgradedConsensusStateRequest; - if (object.last_height !== undefined && object.last_height !== null) { - message.last_height = object.last_height; - } else { - message.last_height = 0; - } - return message; - }, -}; - -const baseQueryUpgradedConsensusStateResponse: object = {}; - -export const QueryUpgradedConsensusStateResponse = { - encode( - message: QueryUpgradedConsensusStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.upgraded_consensus_state.length !== 0) { - writer.uint32(18).bytes(message.upgraded_consensus_state); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUpgradedConsensusStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUpgradedConsensusStateResponse, - } as QueryUpgradedConsensusStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.upgraded_consensus_state = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUpgradedConsensusStateResponse { - const message = { - ...baseQueryUpgradedConsensusStateResponse, - } as QueryUpgradedConsensusStateResponse; - if ( - object.upgraded_consensus_state !== undefined && - object.upgraded_consensus_state !== null - ) { - message.upgraded_consensus_state = bytesFromBase64( - object.upgraded_consensus_state - ); - } - return message; - }, - - toJSON(message: QueryUpgradedConsensusStateResponse): unknown { - const obj: any = {}; - message.upgraded_consensus_state !== undefined && - (obj.upgraded_consensus_state = base64FromBytes( - message.upgraded_consensus_state !== undefined - ? message.upgraded_consensus_state - : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUpgradedConsensusStateResponse { - const message = { - ...baseQueryUpgradedConsensusStateResponse, - } as QueryUpgradedConsensusStateResponse; - if ( - object.upgraded_consensus_state !== undefined && - object.upgraded_consensus_state !== null - ) { - message.upgraded_consensus_state = object.upgraded_consensus_state; - } else { - message.upgraded_consensus_state = new Uint8Array(); - } - return message; - }, -}; - -const baseQueryModuleVersionsRequest: object = { module_name: "" }; - -export const QueryModuleVersionsRequest = { - encode( - message: QueryModuleVersionsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.module_name !== "") { - writer.uint32(10).string(message.module_name); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryModuleVersionsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryModuleVersionsRequest, - } as QueryModuleVersionsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.module_name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryModuleVersionsRequest { - const message = { - ...baseQueryModuleVersionsRequest, - } as QueryModuleVersionsRequest; - if (object.module_name !== undefined && object.module_name !== null) { - message.module_name = String(object.module_name); - } else { - message.module_name = ""; - } - return message; - }, - - toJSON(message: QueryModuleVersionsRequest): unknown { - const obj: any = {}; - message.module_name !== undefined && - (obj.module_name = message.module_name); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryModuleVersionsRequest { - const message = { - ...baseQueryModuleVersionsRequest, - } as QueryModuleVersionsRequest; - if (object.module_name !== undefined && object.module_name !== null) { - message.module_name = object.module_name; - } else { - message.module_name = ""; - } - return message; - }, -}; - -const baseQueryModuleVersionsResponse: object = {}; - -export const QueryModuleVersionsResponse = { - encode( - message: QueryModuleVersionsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.module_versions) { - ModuleVersion.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryModuleVersionsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryModuleVersionsResponse, - } as QueryModuleVersionsResponse; - message.module_versions = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.module_versions.push( - ModuleVersion.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryModuleVersionsResponse { - const message = { - ...baseQueryModuleVersionsResponse, - } as QueryModuleVersionsResponse; - message.module_versions = []; - if ( - object.module_versions !== undefined && - object.module_versions !== null - ) { - for (const e of object.module_versions) { - message.module_versions.push(ModuleVersion.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: QueryModuleVersionsResponse): unknown { - const obj: any = {}; - if (message.module_versions) { - obj.module_versions = message.module_versions.map((e) => - e ? ModuleVersion.toJSON(e) : undefined - ); - } else { - obj.module_versions = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryModuleVersionsResponse { - const message = { - ...baseQueryModuleVersionsResponse, - } as QueryModuleVersionsResponse; - message.module_versions = []; - if ( - object.module_versions !== undefined && - object.module_versions !== null - ) { - for (const e of object.module_versions) { - message.module_versions.push(ModuleVersion.fromPartial(e)); - } - } - return message; - }, -}; - -/** Query defines the gRPC upgrade querier service. */ -export interface Query { - /** CurrentPlan queries the current upgrade plan. */ - CurrentPlan( - request: QueryCurrentPlanRequest - ): Promise; - /** AppliedPlan queries a previously applied upgrade plan by its name. */ - AppliedPlan( - request: QueryAppliedPlanRequest - ): Promise; - /** - * UpgradedConsensusState queries the consensus state that will serve - * as a trusted kernel for the next version of this chain. It will only be - * stored at the last height of this chain. - * UpgradedConsensusState RPC not supported with legacy querier - * This rpc is deprecated now that IBC has its own replacement - * (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - * - * @deprecated - */ - UpgradedConsensusState( - request: QueryUpgradedConsensusStateRequest - ): Promise; - /** - * ModuleVersions queries the list of module versions from state. - * - * Since: cosmos-sdk 0.43 - */ - ModuleVersions( - request: QueryModuleVersionsRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - CurrentPlan( - request: QueryCurrentPlanRequest - ): Promise { - const data = QueryCurrentPlanRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.upgrade.v1beta1.Query", - "CurrentPlan", - data - ); - return promise.then((data) => - QueryCurrentPlanResponse.decode(new Reader(data)) - ); - } - - AppliedPlan( - request: QueryAppliedPlanRequest - ): Promise { - const data = QueryAppliedPlanRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.upgrade.v1beta1.Query", - "AppliedPlan", - data - ); - return promise.then((data) => - QueryAppliedPlanResponse.decode(new Reader(data)) - ); - } - - UpgradedConsensusState( - request: QueryUpgradedConsensusStateRequest - ): Promise { - const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.upgrade.v1beta1.Query", - "UpgradedConsensusState", - data - ); - return promise.then((data) => - QueryUpgradedConsensusStateResponse.decode(new Reader(data)) - ); - } - - ModuleVersions( - request: QueryModuleVersionsRequest - ): Promise { - const data = QueryModuleVersionsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.upgrade.v1beta1.Query", - "ModuleVersions", - data - ); - return promise.then((data) => - QueryModuleVersionsResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/cosmos/upgrade/v1beta1/upgrade.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/cosmos/upgrade/v1beta1/upgrade.ts deleted file mode 100644 index 5d33e73e..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/cosmos/upgrade/v1beta1/upgrade.ts +++ /dev/null @@ -1,543 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; - -export const protobufPackage = "cosmos.upgrade.v1beta1"; - -/** Plan specifies information about a planned upgrade and when it should occur. */ -export interface Plan { - /** - * Sets the name for the upgrade. This name will be used by the upgraded - * version of the software to apply any special "on-upgrade" commands during - * the first BeginBlock method after the upgrade is applied. It is also used - * to detect whether a software version can handle a given upgrade. If no - * upgrade handler with this name has been set in the software, it will be - * assumed that the software is out-of-date when the upgrade Time or Height is - * reached and the software will exit. - */ - name: string; - /** - * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic - * has been removed from the SDK. - * If this field is not empty, an error will be thrown. - * - * @deprecated - */ - time: Date | undefined; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ - height: number; - /** - * Any application specific upgrade info to be included on-chain - * such as a git commit that validators could automatically upgrade to - */ - info: string; - /** - * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been - * moved to the IBC module in the sub module 02-client. - * If this field is not empty, an error will be thrown. - * - * @deprecated - */ - upgraded_client_state: Any | undefined; -} - -/** - * SoftwareUpgradeProposal is a gov Content type for initiating a software - * upgrade. - */ -export interface SoftwareUpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; -} - -/** - * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software - * upgrade. - */ -export interface CancelSoftwareUpgradeProposal { - title: string; - description: string; -} - -/** - * ModuleVersion specifies a module and its consensus version. - * - * Since: cosmos-sdk 0.43 - */ -export interface ModuleVersion { - /** name of the app module */ - name: string; - /** consensus version of the app module */ - version: number; -} - -const basePlan: object = { name: "", height: 0, info: "" }; - -export const Plan = { - encode(message: Plan, writer: Writer = Writer.create()): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - if (message.upgraded_client_state !== undefined) { - Any.encode( - message.upgraded_client_state, - writer.uint32(42).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePlan } as Plan; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.info = reader.string(); - break; - case 5: - message.upgraded_client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromJSON( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, - - toJSON(message: Plan): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.height !== undefined && (obj.height = message.height); - message.info !== undefined && (obj.info = message.info); - message.upgraded_client_state !== undefined && - (obj.upgraded_client_state = message.upgraded_client_state - ? Any.toJSON(message.upgraded_client_state) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromPartial( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, -}; - -const baseSoftwareUpgradeProposal: object = { title: "", description: "" }; - -export const SoftwareUpgradeProposal = { - encode( - message: SoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - return message; - }, - - toJSON(message: SoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - return message; - }, -}; - -const baseCancelSoftwareUpgradeProposal: object = { - title: "", - description: "", -}; - -export const CancelSoftwareUpgradeProposal = { - encode( - message: CancelSoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CancelSoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - return message; - }, - - toJSON(message: CancelSoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - return obj; - }, - - fromPartial( - object: DeepPartial - ): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - return message; - }, -}; - -const baseModuleVersion: object = { name: "", version: 0 }; - -export const ModuleVersion = { - encode(message: ModuleVersion, writer: Writer = Writer.create()): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.version !== 0) { - writer.uint32(16).uint64(message.version); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ModuleVersion { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModuleVersion } as ModuleVersion; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.version = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ModuleVersion { - const message = { ...baseModuleVersion } as ModuleVersion; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = Number(object.version); - } else { - message.version = 0; - } - return message; - }, - - toJSON(message: ModuleVersion): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.version !== undefined && (obj.version = message.version); - return obj; - }, - - fromPartial(object: DeepPartial): ModuleVersion { - const message = { ...baseModuleVersion } as ModuleVersion; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/package.json deleted file mode 100644 index 46ed6861..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-upgrade-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.upgrade.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/upgrade/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.upgrade.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/index.ts deleted file mode 100644 index 0b5116da..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/index.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { BaseVestingAccount } from "./module/types/cosmos/vesting/v1beta1/vesting" -import { ContinuousVestingAccount } from "./module/types/cosmos/vesting/v1beta1/vesting" -import { DelayedVestingAccount } from "./module/types/cosmos/vesting/v1beta1/vesting" -import { Period } from "./module/types/cosmos/vesting/v1beta1/vesting" -import { PeriodicVestingAccount } from "./module/types/cosmos/vesting/v1beta1/vesting" -import { PermanentLockedAccount } from "./module/types/cosmos/vesting/v1beta1/vesting" - - -export { BaseVestingAccount, ContinuousVestingAccount, DelayedVestingAccount, Period, PeriodicVestingAccount, PermanentLockedAccount }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - - _Structure: { - BaseVestingAccount: getStructure(BaseVestingAccount.fromPartial({})), - ContinuousVestingAccount: getStructure(ContinuousVestingAccount.fromPartial({})), - DelayedVestingAccount: getStructure(DelayedVestingAccount.fromPartial({})), - Period: getStructure(Period.fromPartial({})), - PeriodicVestingAccount: getStructure(PeriodicVestingAccount.fromPartial({})), - PermanentLockedAccount: getStructure(PermanentLockedAccount.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: cosmos.vesting.v1beta1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - async sendMsgCreateVestingAccount({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateVestingAccount(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateVestingAccount:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateVestingAccount:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgCreateVestingAccount({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateVestingAccount(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateVestingAccount:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateVestingAccount:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/index.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/index.ts deleted file mode 100644 index 1ae2ff58..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgCreateVestingAccount } from "./types/cosmos/vesting/v1beta1/tx"; - - -const types = [ - ["/cosmos.vesting.v1beta1.MsgCreateVestingAccount", MsgCreateVestingAccount], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCreateVestingAccount: (data: MsgCreateVestingAccount): EncodeObject => ({ typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", value: MsgCreateVestingAccount.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/rest.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/rest.ts deleted file mode 100644 index 5ec60ced..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/rest.ts +++ /dev/null @@ -1,347 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* 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 V1Beta1Coin { - denom?: string; - amount?: string; -} - -/** - * MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. - */ -export type V1Beta1MsgCreateVestingAccountResponse = object; - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title cosmos/vesting/v1beta1/tx.proto - * @version version not set - */ -export class Api extends HttpClient {} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/auth/v1beta1/auth.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/auth/v1beta1/auth.ts deleted file mode 100644 index c7448a25..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/auth/v1beta1/auth.ts +++ /dev/null @@ -1,441 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; - -export const protobufPackage = "cosmos.auth.v1beta1"; - -/** - * BaseAccount defines a base account type. It contains all the necessary fields - * for basic account functionality. Any custom account type should extend this - * type for additional functionality (e.g. vesting). - */ -export interface BaseAccount { - address: string; - pub_key: Any | undefined; - account_number: number; - sequence: number; -} - -/** ModuleAccount defines an account for modules that holds coins on a pool. */ -export interface ModuleAccount { - base_account: BaseAccount | undefined; - name: string; - permissions: string[]; -} - -/** Params defines the parameters for the auth module. */ -export interface Params { - max_memo_characters: number; - tx_sig_limit: number; - tx_size_cost_per_byte: number; - sig_verify_cost_ed25519: number; - sig_verify_cost_secp256k1: number; -} - -const baseBaseAccount: object = { address: "", account_number: 0, sequence: 0 }; - -export const BaseAccount = { - encode(message: BaseAccount, writer: Writer = Writer.create()): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.pub_key !== undefined) { - Any.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); - } - if (message.account_number !== 0) { - writer.uint32(24).uint64(message.account_number); - } - if (message.sequence !== 0) { - writer.uint32(32).uint64(message.sequence); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BaseAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBaseAccount } as BaseAccount; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.pub_key = Any.decode(reader, reader.uint32()); - break; - case 3: - message.account_number = longToNumber(reader.uint64() as Long); - break; - case 4: - message.sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BaseAccount { - const message = { ...baseBaseAccount } as BaseAccount; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = Number(object.account_number); - } else { - message.account_number = 0; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; - }, - - toJSON(message: BaseAccount): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key ? Any.toJSON(message.pub_key) : undefined); - message.account_number !== undefined && - (obj.account_number = message.account_number); - message.sequence !== undefined && (obj.sequence = message.sequence); - return obj; - }, - - fromPartial(object: DeepPartial): BaseAccount { - const message = { ...baseBaseAccount } as BaseAccount; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = object.account_number; - } else { - message.account_number = 0; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - return message; - }, -}; - -const baseModuleAccount: object = { name: "", permissions: "" }; - -export const ModuleAccount = { - encode(message: ModuleAccount, writer: Writer = Writer.create()): Writer { - if (message.base_account !== undefined) { - BaseAccount.encode( - message.base_account, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.name !== "") { - writer.uint32(18).string(message.name); - } - for (const v of message.permissions) { - writer.uint32(26).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ModuleAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_account = BaseAccount.decode(reader, reader.uint32()); - break; - case 2: - message.name = reader.string(); - break; - case 3: - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ModuleAccount { - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromJSON(object.base_account); - } else { - message.base_account = undefined; - } - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.permissions !== undefined && object.permissions !== null) { - for (const e of object.permissions) { - message.permissions.push(String(e)); - } - } - return message; - }, - - toJSON(message: ModuleAccount): unknown { - const obj: any = {}; - message.base_account !== undefined && - (obj.base_account = message.base_account - ? BaseAccount.toJSON(message.base_account) - : undefined); - message.name !== undefined && (obj.name = message.name); - if (message.permissions) { - obj.permissions = message.permissions.map((e) => e); - } else { - obj.permissions = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ModuleAccount { - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromPartial(object.base_account); - } else { - message.base_account = undefined; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.permissions !== undefined && object.permissions !== null) { - for (const e of object.permissions) { - message.permissions.push(e); - } - } - return message; - }, -}; - -const baseParams: object = { - max_memo_characters: 0, - tx_sig_limit: 0, - tx_size_cost_per_byte: 0, - sig_verify_cost_ed25519: 0, - sig_verify_cost_secp256k1: 0, -}; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.max_memo_characters !== 0) { - writer.uint32(8).uint64(message.max_memo_characters); - } - if (message.tx_sig_limit !== 0) { - writer.uint32(16).uint64(message.tx_sig_limit); - } - if (message.tx_size_cost_per_byte !== 0) { - writer.uint32(24).uint64(message.tx_size_cost_per_byte); - } - if (message.sig_verify_cost_ed25519 !== 0) { - writer.uint32(32).uint64(message.sig_verify_cost_ed25519); - } - if (message.sig_verify_cost_secp256k1 !== 0) { - writer.uint32(40).uint64(message.sig_verify_cost_secp256k1); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_memo_characters = longToNumber(reader.uint64() as Long); - break; - case 2: - message.tx_sig_limit = longToNumber(reader.uint64() as Long); - break; - case 3: - message.tx_size_cost_per_byte = longToNumber(reader.uint64() as Long); - break; - case 4: - message.sig_verify_cost_ed25519 = longToNumber( - reader.uint64() as Long - ); - break; - case 5: - message.sig_verify_cost_secp256k1 = longToNumber( - reader.uint64() as Long - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if ( - object.max_memo_characters !== undefined && - object.max_memo_characters !== null - ) { - message.max_memo_characters = Number(object.max_memo_characters); - } else { - message.max_memo_characters = 0; - } - if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { - message.tx_sig_limit = Number(object.tx_sig_limit); - } else { - message.tx_sig_limit = 0; - } - if ( - object.tx_size_cost_per_byte !== undefined && - object.tx_size_cost_per_byte !== null - ) { - message.tx_size_cost_per_byte = Number(object.tx_size_cost_per_byte); - } else { - message.tx_size_cost_per_byte = 0; - } - if ( - object.sig_verify_cost_ed25519 !== undefined && - object.sig_verify_cost_ed25519 !== null - ) { - message.sig_verify_cost_ed25519 = Number(object.sig_verify_cost_ed25519); - } else { - message.sig_verify_cost_ed25519 = 0; - } - if ( - object.sig_verify_cost_secp256k1 !== undefined && - object.sig_verify_cost_secp256k1 !== null - ) { - message.sig_verify_cost_secp256k1 = Number( - object.sig_verify_cost_secp256k1 - ); - } else { - message.sig_verify_cost_secp256k1 = 0; - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.max_memo_characters !== undefined && - (obj.max_memo_characters = message.max_memo_characters); - message.tx_sig_limit !== undefined && - (obj.tx_sig_limit = message.tx_sig_limit); - message.tx_size_cost_per_byte !== undefined && - (obj.tx_size_cost_per_byte = message.tx_size_cost_per_byte); - message.sig_verify_cost_ed25519 !== undefined && - (obj.sig_verify_cost_ed25519 = message.sig_verify_cost_ed25519); - message.sig_verify_cost_secp256k1 !== undefined && - (obj.sig_verify_cost_secp256k1 = message.sig_verify_cost_secp256k1); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if ( - object.max_memo_characters !== undefined && - object.max_memo_characters !== null - ) { - message.max_memo_characters = object.max_memo_characters; - } else { - message.max_memo_characters = 0; - } - if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { - message.tx_sig_limit = object.tx_sig_limit; - } else { - message.tx_sig_limit = 0; - } - if ( - object.tx_size_cost_per_byte !== undefined && - object.tx_size_cost_per_byte !== null - ) { - message.tx_size_cost_per_byte = object.tx_size_cost_per_byte; - } else { - message.tx_size_cost_per_byte = 0; - } - if ( - object.sig_verify_cost_ed25519 !== undefined && - object.sig_verify_cost_ed25519 !== null - ) { - message.sig_verify_cost_ed25519 = object.sig_verify_cost_ed25519; - } else { - message.sig_verify_cost_ed25519 = 0; - } - if ( - object.sig_verify_cost_secp256k1 !== undefined && - object.sig_verify_cost_secp256k1 !== null - ) { - message.sig_verify_cost_secp256k1 = object.sig_verify_cost_secp256k1; - } else { - message.sig_verify_cost_secp256k1 = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ce2ac984..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - 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 { - denom: string; - amount: string; -} - -/** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProto { - int: string; -} - -/** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProto { - dec: string; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - 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 { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - 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): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { - if (message.int !== "") { - writer.uint32(10).string(message.int); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - 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 { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { - if (message.dec !== "") { - writer.uint32(10).string(message.dec); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - 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 { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/vesting/v1beta1/tx.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/vesting/v1beta1/tx.ts deleted file mode 100644 index 85c2c5cd..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/vesting/v1beta1/tx.ts +++ /dev/null @@ -1,292 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmos.vesting.v1beta1"; - -/** - * MsgCreateVestingAccount defines a message that enables creating a vesting - * account. - */ -export interface MsgCreateVestingAccount { - from_address: string; - to_address: string; - amount: Coin[]; - end_time: number; - delayed: boolean; -} - -/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ -export interface MsgCreateVestingAccountResponse {} - -const baseMsgCreateVestingAccount: object = { - from_address: "", - to_address: "", - end_time: 0, - delayed: false, -}; - -export const MsgCreateVestingAccount = { - encode( - message: MsgCreateVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.from_address !== "") { - writer.uint32(10).string(message.from_address); - } - if (message.to_address !== "") { - writer.uint32(18).string(message.to_address); - } - for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.end_time !== 0) { - writer.uint32(32).int64(message.end_time); - } - if (message.delayed === true) { - writer.uint32(40).bool(message.delayed); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgCreateVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgCreateVestingAccount, - } as MsgCreateVestingAccount; - message.amount = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.from_address = reader.string(); - break; - case 2: - message.to_address = reader.string(); - break; - case 3: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; - case 4: - message.end_time = longToNumber(reader.int64() as Long); - break; - case 5: - message.delayed = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateVestingAccount { - const message = { - ...baseMsgCreateVestingAccount, - } as MsgCreateVestingAccount; - message.amount = []; - if (object.from_address !== undefined && object.from_address !== null) { - message.from_address = String(object.from_address); - } else { - message.from_address = ""; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.to_address = String(object.to_address); - } else { - message.to_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - if (object.end_time !== undefined && object.end_time !== null) { - message.end_time = Number(object.end_time); - } else { - message.end_time = 0; - } - if (object.delayed !== undefined && object.delayed !== null) { - message.delayed = Boolean(object.delayed); - } else { - message.delayed = false; - } - return message; - }, - - toJSON(message: MsgCreateVestingAccount): unknown { - const obj: any = {}; - message.from_address !== undefined && - (obj.from_address = message.from_address); - message.to_address !== undefined && (obj.to_address = message.to_address); - if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.amount = []; - } - message.end_time !== undefined && (obj.end_time = message.end_time); - message.delayed !== undefined && (obj.delayed = message.delayed); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgCreateVestingAccount { - const message = { - ...baseMsgCreateVestingAccount, - } as MsgCreateVestingAccount; - message.amount = []; - if (object.from_address !== undefined && object.from_address !== null) { - message.from_address = object.from_address; - } else { - message.from_address = ""; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.to_address = object.to_address; - } else { - message.to_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } - if (object.end_time !== undefined && object.end_time !== null) { - message.end_time = object.end_time; - } else { - message.end_time = 0; - } - if (object.delayed !== undefined && object.delayed !== null) { - message.delayed = object.delayed; - } else { - message.delayed = false; - } - return message; - }, -}; - -const baseMsgCreateVestingAccountResponse: object = {}; - -export const MsgCreateVestingAccountResponse = { - encode( - _: MsgCreateVestingAccountResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgCreateVestingAccountResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgCreateVestingAccountResponse, - } as MsgCreateVestingAccountResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateVestingAccountResponse { - const message = { - ...baseMsgCreateVestingAccountResponse, - } as MsgCreateVestingAccountResponse; - return message; - }, - - toJSON(_: MsgCreateVestingAccountResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgCreateVestingAccountResponse { - const message = { - ...baseMsgCreateVestingAccountResponse, - } as MsgCreateVestingAccountResponse; - return message; - }, -}; - -/** Msg defines the bank Msg service. */ -export interface Msg { - /** - * CreateVestingAccount defines a method that enables creating a vesting - * account. - */ - CreateVestingAccount( - request: MsgCreateVestingAccount - ): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - CreateVestingAccount( - request: MsgCreateVestingAccount - ): Promise { - const data = MsgCreateVestingAccount.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.vesting.v1beta1.Msg", - "CreateVestingAccount", - data - ); - return promise.then((data) => - MsgCreateVestingAccountResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/vesting/v1beta1/vesting.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/vesting/v1beta1/vesting.ts deleted file mode 100644 index 510336dc..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos/vesting/v1beta1/vesting.ts +++ /dev/null @@ -1,738 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { BaseAccount } from "../../../cosmos/auth/v1beta1/auth"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmos.vesting.v1beta1"; - -/** - * BaseVestingAccount implements the VestingAccount interface. It contains all - * the necessary fields needed for any vesting account implementation. - */ -export interface BaseVestingAccount { - base_account: BaseAccount | undefined; - original_vesting: Coin[]; - delegated_free: Coin[]; - delegated_vesting: Coin[]; - end_time: number; -} - -/** - * ContinuousVestingAccount implements the VestingAccount interface. It - * continuously vests by unlocking coins linearly with respect to time. - */ -export interface ContinuousVestingAccount { - base_vesting_account: BaseVestingAccount | undefined; - start_time: number; -} - -/** - * DelayedVestingAccount implements the VestingAccount interface. It vests all - * coins after a specific time, but non prior. In other words, it keeps them - * locked until a specified time. - */ -export interface DelayedVestingAccount { - base_vesting_account: BaseVestingAccount | undefined; -} - -/** Period defines a length of time and amount of coins that will vest. */ -export interface Period { - length: number; - amount: Coin[]; -} - -/** - * PeriodicVestingAccount implements the VestingAccount interface. It - * periodically vests by unlocking coins during each specified period. - */ -export interface PeriodicVestingAccount { - base_vesting_account: BaseVestingAccount | undefined; - start_time: number; - vesting_periods: Period[]; -} - -/** - * PermanentLockedAccount implements the VestingAccount interface. It does - * not ever release coins, locking them indefinitely. Coins in this account can - * still be used for delegating and for governance votes even while locked. - * - * Since: cosmos-sdk 0.43 - */ -export interface PermanentLockedAccount { - base_vesting_account: BaseVestingAccount | undefined; -} - -const baseBaseVestingAccount: object = { end_time: 0 }; - -export const BaseVestingAccount = { - encode( - message: BaseVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_account !== undefined) { - BaseAccount.encode( - message.base_account, - writer.uint32(10).fork() - ).ldelim(); - } - for (const v of message.original_vesting) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.delegated_free) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.delegated_vesting) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); - } - if (message.end_time !== 0) { - writer.uint32(40).int64(message.end_time); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BaseVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBaseVestingAccount } as BaseVestingAccount; - message.original_vesting = []; - message.delegated_free = []; - message.delegated_vesting = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_account = BaseAccount.decode(reader, reader.uint32()); - break; - case 2: - message.original_vesting.push(Coin.decode(reader, reader.uint32())); - break; - case 3: - message.delegated_free.push(Coin.decode(reader, reader.uint32())); - break; - case 4: - message.delegated_vesting.push(Coin.decode(reader, reader.uint32())); - break; - case 5: - message.end_time = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BaseVestingAccount { - const message = { ...baseBaseVestingAccount } as BaseVestingAccount; - message.original_vesting = []; - message.delegated_free = []; - message.delegated_vesting = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromJSON(object.base_account); - } else { - message.base_account = undefined; - } - if ( - object.original_vesting !== undefined && - object.original_vesting !== null - ) { - for (const e of object.original_vesting) { - message.original_vesting.push(Coin.fromJSON(e)); - } - } - if (object.delegated_free !== undefined && object.delegated_free !== null) { - for (const e of object.delegated_free) { - message.delegated_free.push(Coin.fromJSON(e)); - } - } - if ( - object.delegated_vesting !== undefined && - object.delegated_vesting !== null - ) { - for (const e of object.delegated_vesting) { - message.delegated_vesting.push(Coin.fromJSON(e)); - } - } - if (object.end_time !== undefined && object.end_time !== null) { - message.end_time = Number(object.end_time); - } else { - message.end_time = 0; - } - return message; - }, - - toJSON(message: BaseVestingAccount): unknown { - const obj: any = {}; - message.base_account !== undefined && - (obj.base_account = message.base_account - ? BaseAccount.toJSON(message.base_account) - : undefined); - if (message.original_vesting) { - obj.original_vesting = message.original_vesting.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.original_vesting = []; - } - if (message.delegated_free) { - obj.delegated_free = message.delegated_free.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.delegated_free = []; - } - if (message.delegated_vesting) { - obj.delegated_vesting = message.delegated_vesting.map((e) => - e ? Coin.toJSON(e) : undefined - ); - } else { - obj.delegated_vesting = []; - } - message.end_time !== undefined && (obj.end_time = message.end_time); - return obj; - }, - - fromPartial(object: DeepPartial): BaseVestingAccount { - const message = { ...baseBaseVestingAccount } as BaseVestingAccount; - message.original_vesting = []; - message.delegated_free = []; - message.delegated_vesting = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromPartial(object.base_account); - } else { - message.base_account = undefined; - } - if ( - object.original_vesting !== undefined && - object.original_vesting !== null - ) { - for (const e of object.original_vesting) { - message.original_vesting.push(Coin.fromPartial(e)); - } - } - if (object.delegated_free !== undefined && object.delegated_free !== null) { - for (const e of object.delegated_free) { - message.delegated_free.push(Coin.fromPartial(e)); - } - } - if ( - object.delegated_vesting !== undefined && - object.delegated_vesting !== null - ) { - for (const e of object.delegated_vesting) { - message.delegated_vesting.push(Coin.fromPartial(e)); - } - } - if (object.end_time !== undefined && object.end_time !== null) { - message.end_time = object.end_time; - } else { - message.end_time = 0; - } - return message; - }, -}; - -const baseContinuousVestingAccount: object = { start_time: 0 }; - -export const ContinuousVestingAccount = { - encode( - message: ContinuousVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_vesting_account !== undefined) { - BaseVestingAccount.encode( - message.base_vesting_account, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.start_time !== 0) { - writer.uint32(16).int64(message.start_time); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ContinuousVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseContinuousVestingAccount, - } as ContinuousVestingAccount; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_vesting_account = BaseVestingAccount.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.start_time = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ContinuousVestingAccount { - const message = { - ...baseContinuousVestingAccount, - } as ContinuousVestingAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromJSON( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - if (object.start_time !== undefined && object.start_time !== null) { - message.start_time = Number(object.start_time); - } else { - message.start_time = 0; - } - return message; - }, - - toJSON(message: ContinuousVestingAccount): unknown { - const obj: any = {}; - message.base_vesting_account !== undefined && - (obj.base_vesting_account = message.base_vesting_account - ? BaseVestingAccount.toJSON(message.base_vesting_account) - : undefined); - message.start_time !== undefined && (obj.start_time = message.start_time); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ContinuousVestingAccount { - const message = { - ...baseContinuousVestingAccount, - } as ContinuousVestingAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromPartial( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - if (object.start_time !== undefined && object.start_time !== null) { - message.start_time = object.start_time; - } else { - message.start_time = 0; - } - return message; - }, -}; - -const baseDelayedVestingAccount: object = {}; - -export const DelayedVestingAccount = { - encode( - message: DelayedVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_vesting_account !== undefined) { - BaseVestingAccount.encode( - message.base_vesting_account, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DelayedVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelayedVestingAccount } as DelayedVestingAccount; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_vesting_account = BaseVestingAccount.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DelayedVestingAccount { - const message = { ...baseDelayedVestingAccount } as DelayedVestingAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromJSON( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - return message; - }, - - toJSON(message: DelayedVestingAccount): unknown { - const obj: any = {}; - message.base_vesting_account !== undefined && - (obj.base_vesting_account = message.base_vesting_account - ? BaseVestingAccount.toJSON(message.base_vesting_account) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DelayedVestingAccount { - const message = { ...baseDelayedVestingAccount } as DelayedVestingAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromPartial( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - return message; - }, -}; - -const basePeriod: object = { length: 0 }; - -export const Period = { - encode(message: Period, writer: Writer = Writer.create()): Writer { - if (message.length !== 0) { - writer.uint32(8).int64(message.length); - } - for (const v of message.amount) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Period { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePeriod } as Period; - message.amount = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.length = longToNumber(reader.int64() as Long); - break; - case 2: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Period { - const message = { ...basePeriod } as Period; - message.amount = []; - if (object.length !== undefined && object.length !== null) { - message.length = Number(object.length); - } else { - message.length = 0; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: Period): unknown { - const obj: any = {}; - message.length !== undefined && (obj.length = message.length); - if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.amount = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Period { - const message = { ...basePeriod } as Period; - message.amount = []; - if (object.length !== undefined && object.length !== null) { - message.length = object.length; - } else { - message.length = 0; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const basePeriodicVestingAccount: object = { start_time: 0 }; - -export const PeriodicVestingAccount = { - encode( - message: PeriodicVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_vesting_account !== undefined) { - BaseVestingAccount.encode( - message.base_vesting_account, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.start_time !== 0) { - writer.uint32(16).int64(message.start_time); - } - for (const v of message.vesting_periods) { - Period.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PeriodicVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePeriodicVestingAccount } as PeriodicVestingAccount; - message.vesting_periods = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_vesting_account = BaseVestingAccount.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.start_time = longToNumber(reader.int64() as Long); - break; - case 3: - message.vesting_periods.push(Period.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PeriodicVestingAccount { - const message = { ...basePeriodicVestingAccount } as PeriodicVestingAccount; - message.vesting_periods = []; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromJSON( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - if (object.start_time !== undefined && object.start_time !== null) { - message.start_time = Number(object.start_time); - } else { - message.start_time = 0; - } - if ( - object.vesting_periods !== undefined && - object.vesting_periods !== null - ) { - for (const e of object.vesting_periods) { - message.vesting_periods.push(Period.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: PeriodicVestingAccount): unknown { - const obj: any = {}; - message.base_vesting_account !== undefined && - (obj.base_vesting_account = message.base_vesting_account - ? BaseVestingAccount.toJSON(message.base_vesting_account) - : undefined); - message.start_time !== undefined && (obj.start_time = message.start_time); - if (message.vesting_periods) { - obj.vesting_periods = message.vesting_periods.map((e) => - e ? Period.toJSON(e) : undefined - ); - } else { - obj.vesting_periods = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): PeriodicVestingAccount { - const message = { ...basePeriodicVestingAccount } as PeriodicVestingAccount; - message.vesting_periods = []; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromPartial( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - if (object.start_time !== undefined && object.start_time !== null) { - message.start_time = object.start_time; - } else { - message.start_time = 0; - } - if ( - object.vesting_periods !== undefined && - object.vesting_periods !== null - ) { - for (const e of object.vesting_periods) { - message.vesting_periods.push(Period.fromPartial(e)); - } - } - return message; - }, -}; - -const basePermanentLockedAccount: object = {}; - -export const PermanentLockedAccount = { - encode( - message: PermanentLockedAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_vesting_account !== undefined) { - BaseVestingAccount.encode( - message.base_vesting_account, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PermanentLockedAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePermanentLockedAccount } as PermanentLockedAccount; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_vesting_account = BaseVestingAccount.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PermanentLockedAccount { - const message = { ...basePermanentLockedAccount } as PermanentLockedAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromJSON( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - return message; - }, - - toJSON(message: PermanentLockedAccount): unknown { - const obj: any = {}; - message.base_vesting_account !== undefined && - (obj.base_vesting_account = message.base_vesting_account - ? BaseVestingAccount.toJSON(message.base_vesting_account) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): PermanentLockedAccount { - const message = { ...basePermanentLockedAccount } as PermanentLockedAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromPartial( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos_proto/cosmos.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos_proto/cosmos.ts deleted file mode 100644 index 9ec67a12..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/cosmos_proto/cosmos.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "cosmos_proto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/package.json b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/package.json deleted file mode 100644 index 08ba70cf..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cosmos-vesting-v1beta1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module cosmos.vesting.v1beta1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/cosmos-sdk/x/auth/vesting/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/vuex-root b/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/cosmos-sdk/cosmos.vesting.v1beta1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/index.ts deleted file mode 100644 index 8ca2bebc..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/index.ts +++ /dev/null @@ -1,233 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { DenomTrace } from "./module/types/ibc/applications/transfer/v1/transfer" -import { Params } from "./module/types/ibc/applications/transfer/v1/transfer" - - -export { DenomTrace, Params }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - DenomTrace: {}, - DenomTraces: {}, - Params: {}, - - _Structure: { - DenomTrace: getStructure(DenomTrace.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getDenomTrace: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomTrace[JSON.stringify(params)] ?? {} - }, - getDenomTraces: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomTraces[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.applications.transfer.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryDenomTrace({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDenomTrace( key.hash)).data - - - commit('QUERY', { query: 'DenomTrace', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomTrace', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomTrace']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomTrace API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDenomTraces({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryDenomTraces(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryDenomTraces({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DenomTraces', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomTraces', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomTraces']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomTraces API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgTransfer({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgTransfer(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgTransfer:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgTransfer:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgTransfer({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgTransfer(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgTransfer:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgTransfer:Create Could not create message: ' + e.message) - } - } - }, - - } -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/index.ts deleted file mode 100644 index 2415c023..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgTransfer } from "./types/ibc/applications/transfer/v1/tx"; - - -const types = [ - ["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgTransfer: (data: MsgTransfer): EncodeObject => ({ typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: MsgTransfer.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/rest.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/rest.ts deleted file mode 100644 index bdae05f0..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/rest.ts +++ /dev/null @@ -1,540 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* Params defines the set of IBC transfer parameters. -NOTE: To prevent a single token from being transferred, set the -TransfersEnabled parameter to true and then set the bank module's SendEnabled -parameter for the denomination to false. -*/ -export interface Applicationstransferv1Params { - /** - * send_enabled enables or disables all cross-chain token transfers from this - * chain. - */ - send_enabled?: boolean; - - /** - * receive_enabled enables or disables all cross-chain token transfers to this - * chain. - */ - receive_enabled?: boolean; -} - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* DenomTrace contains the base denomination for ICS20 fungible tokens and the -source tracing information path. -*/ -export interface V1DenomTrace { - /** - * path defines the chain of port/channel identifiers used for tracing the - * source of the fungible token. - */ - path?: string; - - /** base denomination of the relayed fungible token. */ - base_denom?: string; -} - -/** -* Normally the RevisionHeight is incremented at each height while keeping -RevisionNumber the same. However some consensus algorithms may choose to -reset the height in certain conditions e.g. hard forks, state-machine -breaking changes In these cases, the RevisionNumber is incremented so that -height continues to be monitonically increasing even as the RevisionHeight -gets reset -*/ -export interface V1Height { - /** @format uint64 */ - revision_number?: string; - - /** @format uint64 */ - revision_height?: string; -} - -/** - * MsgTransferResponse defines the Msg/Transfer response type. - */ -export type V1MsgTransferResponse = object; - -/** -* QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC -method. -*/ -export interface V1QueryDenomTraceResponse { - /** denom_trace returns the requested denomination trace information. */ - denom_trace?: V1DenomTrace; -} - -/** -* QueryConnectionsResponse is the response type for the Query/DenomTraces RPC -method. -*/ -export interface V1QueryDenomTracesResponse { - /** denom_traces returns all denominations trace information. */ - denom_traces?: V1DenomTrace[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** - * QueryParamsResponse is the response type for the Query/Params RPC method. - */ -export interface V1QueryParamsResponse { - /** params defines the parameters of the module. */ - params?: Applicationstransferv1Params; -} - -/** -* 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 V1Beta1Coin { - denom?: string; - amount?: string; -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title ibc/applications/transfer/v1/genesis.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryDenomTraces - * @summary DenomTraces queries all denomination traces. - * @request GET:/ibc/apps/transfer/v1/denom_traces - */ - queryDenomTraces = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/apps/transfer/v1/denom_traces`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryDenomTrace - * @summary DenomTrace queries a denomination trace information. - * @request GET:/ibc/apps/transfer/v1/denom_traces/{hash} - */ - queryDenomTrace = (hash: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/apps/transfer/v1/denom_traces/${hash}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryParams - * @summary Params queries all parameters of the ibc-transfer module. - * @request GET:/ibc/apps/transfer/v1/params - */ - queryParams = (params: RequestParams = {}) => - this.request({ - path: `/ibc/apps/transfer/v1/params`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 0bc568f4..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,300 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { offset: 0, limit: 0, count_total: false }; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ce2ac984..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - 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 { - denom: string; - amount: string; -} - -/** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProto { - int: string; -} - -/** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProto { - dec: string; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - 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 { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.amount !== "") { - writer.uint32(18).string(message.amount); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - 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): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { - if (message.int !== "") { - writer.uint32(10).string(message.int); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - 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 { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { - if (message.dec !== "") { - writer.uint32(10).string(message.dec); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - 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 { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts deleted file mode 100644 index e9cefea2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts +++ /dev/null @@ -1,414 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.upgrade.v1beta1"; - -/** Plan specifies information about a planned upgrade and when it should occur. */ -export interface Plan { - /** - * Sets the name for the upgrade. This name will be used by the upgraded - * version of the software to apply any special "on-upgrade" commands during - * the first BeginBlock method after the upgrade is applied. It is also used - * to detect whether a software version can handle a given upgrade. If no - * upgrade handler with this name has been set in the software, it will be - * assumed that the software is out-of-date when the upgrade Time or Height is - * reached and the software will exit. - */ - name: string; - /** - * The time after which the upgrade must be performed. - * Leave set to its zero value to use a pre-defined Height instead. - */ - time: Date | undefined; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ - height: number; - /** - * Any application specific upgrade info to be included on-chain - * such as a git commit that validators could automatically upgrade to - */ - info: string; -} - -/** - * SoftwareUpgradeProposal is a gov Content type for initiating a software - * upgrade. - */ -export interface SoftwareUpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; -} - -/** - * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software - * upgrade. - */ -export interface CancelSoftwareUpgradeProposal { - title: string; - description: string; -} - -const basePlan: object = { name: "", height: 0, info: "" }; - -export const Plan = { - encode(message: Plan, writer: Writer = Writer.create()): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePlan } as Plan; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - return message; - }, - - toJSON(message: Plan): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.height !== undefined && (obj.height = message.height); - message.info !== undefined && (obj.info = message.info); - return obj; - }, - - fromPartial(object: DeepPartial): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - return message; - }, -}; - -const baseSoftwareUpgradeProposal: object = { title: "", description: "" }; - -export const SoftwareUpgradeProposal = { - encode( - message: SoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - return message; - }, - - toJSON(message: SoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - return message; - }, -}; - -const baseCancelSoftwareUpgradeProposal: object = { - title: "", - description: "", -}; - -export const CancelSoftwareUpgradeProposal = { - encode( - message: CancelSoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CancelSoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - return message; - }, - - toJSON(message: CancelSoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - return obj; - }, - - fromPartial( - object: DeepPartial - ): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/genesis.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/genesis.ts deleted file mode 100644 index a0b97adf..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/genesis.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* eslint-disable */ -import { - DenomTrace, - Params, -} from "../../../../ibc/applications/transfer/v1/transfer"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "ibc.applications.transfer.v1"; - -/** GenesisState defines the ibc-transfer genesis state */ -export interface GenesisState { - port_id: string; - denom_traces: DenomTrace[]; - params: Params | undefined; -} - -const baseGenesisState: object = { port_id: "" }; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - for (const v of message.denom_traces) { - DenomTrace.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.denom_traces = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.denom_traces.push(DenomTrace.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 { - const message = { ...baseGenesisState } as GenesisState; - message.denom_traces = []; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.denom_traces !== undefined && object.denom_traces !== null) { - for (const e of object.denom_traces) { - message.denom_traces.push(DenomTrace.fromJSON(e)); - } - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - if (message.denom_traces) { - obj.denom_traces = message.denom_traces.map((e) => - e ? DenomTrace.toJSON(e) : undefined - ); - } else { - obj.denom_traces = []; - } - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.denom_traces = []; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.denom_traces !== undefined && object.denom_traces !== null) { - for (const e of object.denom_traces) { - message.denom_traces.push(DenomTrace.fromPartial(e)); - } - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/query.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/query.ts deleted file mode 100644 index e28d7075..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/query.ts +++ /dev/null @@ -1,530 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { - DenomTrace, - Params, -} from "../../../../ibc/applications/transfer/v1/transfer"; -import { - PageRequest, - PageResponse, -} from "../../../../cosmos/base/query/v1beta1/pagination"; - -export const protobufPackage = "ibc.applications.transfer.v1"; - -/** - * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC - * method - */ -export interface QueryDenomTraceRequest { - /** hash (in hex format) of the denomination trace information. */ - hash: string; -} - -/** - * QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC - * method. - */ -export interface QueryDenomTraceResponse { - /** denom_trace returns the requested denomination trace information. */ - denom_trace: DenomTrace | undefined; -} - -/** - * QueryConnectionsRequest is the request type for the Query/DenomTraces RPC - * method - */ -export interface QueryDenomTracesRequest { - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryConnectionsResponse is the response type for the Query/DenomTraces RPC - * method. - */ -export interface QueryDenomTracesResponse { - /** denom_traces returns all denominations trace information. */ - denom_traces: DenomTrace[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} - -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponse { - /** params defines the parameters of the module. */ - params: Params | undefined; -} - -const baseQueryDenomTraceRequest: object = { hash: "" }; - -export const QueryDenomTraceRequest = { - encode( - message: QueryDenomTraceRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.hash !== "") { - writer.uint32(10).string(message.hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryDenomTraceRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDenomTraceRequest } as QueryDenomTraceRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDenomTraceRequest { - const message = { ...baseQueryDenomTraceRequest } as QueryDenomTraceRequest; - if (object.hash !== undefined && object.hash !== null) { - message.hash = String(object.hash); - } else { - message.hash = ""; - } - return message; - }, - - toJSON(message: QueryDenomTraceRequest): unknown { - const obj: any = {}; - message.hash !== undefined && (obj.hash = message.hash); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDenomTraceRequest { - const message = { ...baseQueryDenomTraceRequest } as QueryDenomTraceRequest; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = ""; - } - return message; - }, -}; - -const baseQueryDenomTraceResponse: object = {}; - -export const QueryDenomTraceResponse = { - encode( - message: QueryDenomTraceResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.denom_trace !== undefined) { - DenomTrace.encode(message.denom_trace, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryDenomTraceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomTraceResponse, - } as QueryDenomTraceResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom_trace = DenomTrace.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryDenomTraceResponse { - const message = { - ...baseQueryDenomTraceResponse, - } as QueryDenomTraceResponse; - if (object.denom_trace !== undefined && object.denom_trace !== null) { - message.denom_trace = DenomTrace.fromJSON(object.denom_trace); - } else { - message.denom_trace = undefined; - } - return message; - }, - - toJSON(message: QueryDenomTraceResponse): unknown { - const obj: any = {}; - message.denom_trace !== undefined && - (obj.denom_trace = message.denom_trace - ? DenomTrace.toJSON(message.denom_trace) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDenomTraceResponse { - const message = { - ...baseQueryDenomTraceResponse, - } as QueryDenomTraceResponse; - if (object.denom_trace !== undefined && object.denom_trace !== null) { - message.denom_trace = DenomTrace.fromPartial(object.denom_trace); - } else { - message.denom_trace = undefined; - } - return message; - }, -}; - -const baseQueryDenomTracesRequest: object = {}; - -export const QueryDenomTracesRequest = { - encode( - message: QueryDenomTracesRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryDenomTracesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomTracesRequest, - } as QueryDenomTracesRequest; - 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): QueryDenomTracesRequest { - const message = { - ...baseQueryDenomTracesRequest, - } as QueryDenomTracesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDenomTracesRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDenomTracesRequest { - const message = { - ...baseQueryDenomTracesRequest, - } as QueryDenomTracesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryDenomTracesResponse: object = {}; - -export const QueryDenomTracesResponse = { - encode( - message: QueryDenomTracesResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.denom_traces) { - DenomTrace.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomTracesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomTracesResponse, - } as QueryDenomTracesResponse; - message.denom_traces = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom_traces.push(DenomTrace.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): QueryDenomTracesResponse { - const message = { - ...baseQueryDenomTracesResponse, - } as QueryDenomTracesResponse; - message.denom_traces = []; - if (object.denom_traces !== undefined && object.denom_traces !== null) { - for (const e of object.denom_traces) { - message.denom_traces.push(DenomTrace.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryDenomTracesResponse): unknown { - const obj: any = {}; - if (message.denom_traces) { - obj.denom_traces = message.denom_traces.map((e) => - e ? DenomTrace.toJSON(e) : undefined - ); - } else { - obj.denom_traces = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryDenomTracesResponse { - const message = { - ...baseQueryDenomTracesResponse, - } as QueryDenomTracesResponse; - message.denom_traces = []; - if (object.denom_traces !== undefined && object.denom_traces !== null) { - for (const e of object.denom_traces) { - message.denom_traces.push(DenomTrace.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryParamsRequest: object = {}; - -export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, - - toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; - }, -}; - -const baseQueryParamsResponse: object = {}; - -export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - 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): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -/** Query provides defines the gRPC querier service. */ -export interface Query { - /** DenomTrace queries a denomination trace information. */ - DenomTrace(request: QueryDenomTraceRequest): Promise; - /** DenomTraces queries all denomination traces. */ - DenomTraces( - request: QueryDenomTracesRequest - ): Promise; - /** Params queries all parameters of the ibc-transfer module. */ - Params(request: QueryParamsRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - DenomTrace( - request: QueryDenomTraceRequest - ): Promise { - const data = QueryDenomTraceRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.applications.transfer.v1.Query", - "DenomTrace", - data - ); - return promise.then((data) => - QueryDenomTraceResponse.decode(new Reader(data)) - ); - } - - DenomTraces( - request: QueryDenomTracesRequest - ): Promise { - const data = QueryDenomTracesRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.applications.transfer.v1.Query", - "DenomTraces", - data - ); - return promise.then((data) => - QueryDenomTracesResponse.decode(new Reader(data)) - ); - } - - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.applications.transfer.v1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/transfer.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/transfer.ts deleted file mode 100644 index e3533c98..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/transfer.ts +++ /dev/null @@ -1,200 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "ibc.applications.transfer.v1"; - -/** - * DenomTrace contains the base denomination for ICS20 fungible tokens and the - * source tracing information path. - */ -export interface DenomTrace { - /** - * path defines the chain of port/channel identifiers used for tracing the - * source of the fungible token. - */ - path: string; - /** base denomination of the relayed fungible token. */ - base_denom: string; -} - -/** - * Params defines the set of IBC transfer parameters. - * NOTE: To prevent a single token from being transferred, set the - * TransfersEnabled parameter to true and then set the bank module's SendEnabled - * parameter for the denomination to false. - */ -export interface Params { - /** - * send_enabled enables or disables all cross-chain token transfers from this - * chain. - */ - send_enabled: boolean; - /** - * receive_enabled enables or disables all cross-chain token transfers to this - * chain. - */ - receive_enabled: boolean; -} - -const baseDenomTrace: object = { path: "", base_denom: "" }; - -export const DenomTrace = { - encode(message: DenomTrace, writer: Writer = Writer.create()): Writer { - if (message.path !== "") { - writer.uint32(10).string(message.path); - } - if (message.base_denom !== "") { - writer.uint32(18).string(message.base_denom); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DenomTrace { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDenomTrace } as DenomTrace; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.string(); - break; - case 2: - message.base_denom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DenomTrace { - const message = { ...baseDenomTrace } as DenomTrace; - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - if (object.base_denom !== undefined && object.base_denom !== null) { - message.base_denom = String(object.base_denom); - } else { - message.base_denom = ""; - } - return message; - }, - - toJSON(message: DenomTrace): unknown { - const obj: any = {}; - message.path !== undefined && (obj.path = message.path); - message.base_denom !== undefined && (obj.base_denom = message.base_denom); - return obj; - }, - - fromPartial(object: DeepPartial): DenomTrace { - const message = { ...baseDenomTrace } as DenomTrace; - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - if (object.base_denom !== undefined && object.base_denom !== null) { - message.base_denom = object.base_denom; - } else { - message.base_denom = ""; - } - return message; - }, -}; - -const baseParams: object = { send_enabled: false, receive_enabled: false }; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.send_enabled === true) { - writer.uint32(8).bool(message.send_enabled); - } - if (message.receive_enabled === true) { - writer.uint32(16).bool(message.receive_enabled); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.send_enabled = reader.bool(); - break; - case 2: - message.receive_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if (object.send_enabled !== undefined && object.send_enabled !== null) { - message.send_enabled = Boolean(object.send_enabled); - } else { - message.send_enabled = false; - } - if ( - object.receive_enabled !== undefined && - object.receive_enabled !== null - ) { - message.receive_enabled = Boolean(object.receive_enabled); - } else { - message.receive_enabled = false; - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.send_enabled !== undefined && - (obj.send_enabled = message.send_enabled); - message.receive_enabled !== undefined && - (obj.receive_enabled = message.receive_enabled); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if (object.send_enabled !== undefined && object.send_enabled !== null) { - message.send_enabled = object.send_enabled; - } else { - message.send_enabled = false; - } - if ( - object.receive_enabled !== undefined && - object.receive_enabled !== null - ) { - message.receive_enabled = object.receive_enabled; - } else { - message.receive_enabled = false; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/tx.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/tx.ts deleted file mode 100644 index e4ed3fd8..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/applications/transfer/v1/tx.ts +++ /dev/null @@ -1,315 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { Coin } from "../../../../cosmos/base/v1beta1/coin"; -import { Height } from "../../../../ibc/core/client/v1/client"; - -export const protobufPackage = "ibc.applications.transfer.v1"; - -/** - * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between - * ICS20 enabled chains. See ICS Spec here: - * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures - */ -export interface MsgTransfer { - /** the port on which the packet will be sent */ - source_port: string; - /** the channel by which the packet will be sent */ - source_channel: string; - /** the tokens to be transferred */ - token: Coin | undefined; - /** the sender address */ - sender: string; - /** the recipient address on the destination chain */ - receiver: string; - /** - * Timeout height relative to the current block height. - * The timeout is disabled when set to 0. - */ - timeout_height: Height | undefined; - /** - * Timeout timestamp (in nanoseconds) relative to the current block timestamp. - * The timeout is disabled when set to 0. - */ - timeout_timestamp: number; -} - -/** MsgTransferResponse defines the Msg/Transfer response type. */ -export interface MsgTransferResponse {} - -const baseMsgTransfer: object = { - source_port: "", - source_channel: "", - sender: "", - receiver: "", - timeout_timestamp: 0, -}; - -export const MsgTransfer = { - encode(message: MsgTransfer, writer: Writer = Writer.create()): Writer { - if (message.source_port !== "") { - writer.uint32(10).string(message.source_port); - } - if (message.source_channel !== "") { - writer.uint32(18).string(message.source_channel); - } - if (message.token !== undefined) { - Coin.encode(message.token, writer.uint32(26).fork()).ldelim(); - } - if (message.sender !== "") { - writer.uint32(34).string(message.sender); - } - if (message.receiver !== "") { - writer.uint32(42).string(message.receiver); - } - if (message.timeout_height !== undefined) { - Height.encode(message.timeout_height, writer.uint32(50).fork()).ldelim(); - } - if (message.timeout_timestamp !== 0) { - writer.uint32(56).uint64(message.timeout_timestamp); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgTransfer { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgTransfer } as MsgTransfer; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.source_port = reader.string(); - break; - case 2: - message.source_channel = reader.string(); - break; - case 3: - message.token = Coin.decode(reader, reader.uint32()); - break; - case 4: - message.sender = reader.string(); - break; - case 5: - message.receiver = reader.string(); - break; - case 6: - message.timeout_height = Height.decode(reader, reader.uint32()); - break; - case 7: - message.timeout_timestamp = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgTransfer { - const message = { ...baseMsgTransfer } as MsgTransfer; - if (object.source_port !== undefined && object.source_port !== null) { - message.source_port = String(object.source_port); - } else { - message.source_port = ""; - } - if (object.source_channel !== undefined && object.source_channel !== null) { - message.source_channel = String(object.source_channel); - } else { - message.source_channel = ""; - } - if (object.token !== undefined && object.token !== null) { - message.token = Coin.fromJSON(object.token); - } else { - message.token = undefined; - } - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.receiver !== undefined && object.receiver !== null) { - message.receiver = String(object.receiver); - } else { - message.receiver = ""; - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = Height.fromJSON(object.timeout_height); - } else { - message.timeout_height = undefined; - } - if ( - object.timeout_timestamp !== undefined && - object.timeout_timestamp !== null - ) { - message.timeout_timestamp = Number(object.timeout_timestamp); - } else { - message.timeout_timestamp = 0; - } - return message; - }, - - toJSON(message: MsgTransfer): unknown { - const obj: any = {}; - message.source_port !== undefined && - (obj.source_port = message.source_port); - message.source_channel !== undefined && - (obj.source_channel = message.source_channel); - message.token !== undefined && - (obj.token = message.token ? Coin.toJSON(message.token) : undefined); - message.sender !== undefined && (obj.sender = message.sender); - message.receiver !== undefined && (obj.receiver = message.receiver); - message.timeout_height !== undefined && - (obj.timeout_height = message.timeout_height - ? Height.toJSON(message.timeout_height) - : undefined); - message.timeout_timestamp !== undefined && - (obj.timeout_timestamp = message.timeout_timestamp); - return obj; - }, - - fromPartial(object: DeepPartial): MsgTransfer { - const message = { ...baseMsgTransfer } as MsgTransfer; - if (object.source_port !== undefined && object.source_port !== null) { - message.source_port = object.source_port; - } else { - message.source_port = ""; - } - if (object.source_channel !== undefined && object.source_channel !== null) { - message.source_channel = object.source_channel; - } else { - message.source_channel = ""; - } - if (object.token !== undefined && object.token !== null) { - message.token = Coin.fromPartial(object.token); - } else { - message.token = undefined; - } - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.receiver !== undefined && object.receiver !== null) { - message.receiver = object.receiver; - } else { - message.receiver = ""; - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = Height.fromPartial(object.timeout_height); - } else { - message.timeout_height = undefined; - } - if ( - object.timeout_timestamp !== undefined && - object.timeout_timestamp !== null - ) { - message.timeout_timestamp = object.timeout_timestamp; - } else { - message.timeout_timestamp = 0; - } - return message; - }, -}; - -const baseMsgTransferResponse: object = {}; - -export const MsgTransferResponse = { - encode(_: MsgTransferResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgTransferResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgTransferResponse } as MsgTransferResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgTransferResponse { - const message = { ...baseMsgTransferResponse } as MsgTransferResponse; - return message; - }, - - toJSON(_: MsgTransferResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgTransferResponse { - const message = { ...baseMsgTransferResponse } as MsgTransferResponse; - return message; - }, -}; - -/** Msg defines the ibc/transfer Msg service. */ -export interface Msg { - /** Transfer defines a rpc handler method for MsgTransfer. */ - Transfer(request: MsgTransfer): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Transfer(request: MsgTransfer): Promise { - const data = MsgTransfer.encode(request).finish(); - const promise = this.rpc.request( - "ibc.applications.transfer.v1.Msg", - "Transfer", - data - ); - return promise.then((data) => MsgTransferResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/core/client/v1/client.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/core/client/v1/client.ts deleted file mode 100644 index b34686d3..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/module/types/ibc/core/client/v1/client.ts +++ /dev/null @@ -1,814 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; - -export const protobufPackage = "ibc.core.client.v1"; - -/** - * IdentifiedClientState defines a client state with an additional client - * identifier field. - */ -export interface IdentifiedClientState { - /** client identifier */ - client_id: string; - /** client state */ - client_state: Any | undefined; -} - -/** - * ConsensusStateWithHeight defines a consensus state with an additional height - * field. - */ -export interface ConsensusStateWithHeight { - /** consensus state height */ - height: Height | undefined; - /** consensus state */ - consensus_state: Any | undefined; -} - -/** - * ClientConsensusStates defines all the stored consensus states for a given - * client. - */ -export interface ClientConsensusStates { - /** client identifier */ - client_id: string; - /** consensus states and their heights associated with the client */ - consensus_states: ConsensusStateWithHeight[]; -} - -/** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute - * client's latest consensus state is copied over to the subject client. The proposal - * handler may fail if the subject and the substitute do not match in client and - * chain parameters (with exception to latest height, frozen height, and chain-id). - */ -export interface ClientUpdateProposal { - /** the title of the update proposal */ - title: string; - /** the description of the proposal */ - description: string; - /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id: string; - /** - * the substitute client identifier for the client standing in for the subject - * client - */ - substitute_client_id: string; -} - -/** - * UpgradeProposal is a gov Content type for initiating an IBC breaking - * upgrade. - */ -export interface UpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; - /** - * An UpgradedClientState must be provided to perform an IBC breaking upgrade. - * This will make the chain commit to the correct upgraded (self) client state - * before the upgrade occurs, so that connecting chains can verify that the - * new upgraded client is valid by verifying a proof on the previous version - * of the chain. This will allow IBC connections to persist smoothly across - * planned chain upgrades - */ - upgraded_client_state: Any | undefined; -} - -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface Height { - /** the revision that the client is currently on */ - revision_number: number; - /** the height within the given revision */ - revision_height: number; -} - -/** Params defines the set of IBC light client parameters. */ -export interface Params { - /** allowed_clients defines the list of allowed client state types. */ - allowed_clients: string[]; -} - -const baseIdentifiedClientState: object = { client_id: "" }; - -export const IdentifiedClientState = { - encode( - message: IdentifiedClientState, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IdentifiedClientState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, - - toJSON(message: IdentifiedClientState): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, -}; - -const baseConsensusStateWithHeight: object = {}; - -export const ConsensusStateWithHeight = { - encode( - message: ConsensusStateWithHeight, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(10).fork()).ldelim(); - } - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ConsensusStateWithHeight { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = Height.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, - - toJSON(message: ConsensusStateWithHeight): unknown { - const obj: any = {}; - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, -}; - -const baseClientConsensusStates: object = { client_id: "" }; - -export const ClientConsensusStates = { - encode( - message: ClientConsensusStates, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - for (const v of message.consensus_states) { - ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientConsensusStates { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.consensus_states.push( - ConsensusStateWithHeight.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ClientConsensusStates): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - if (message.consensus_states) { - obj.consensus_states = message.consensus_states.map((e) => - e ? ConsensusStateWithHeight.toJSON(e) : undefined - ); - } else { - obj.consensus_states = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromPartial(e)); - } - } - return message; - }, -}; - -const baseClientUpdateProposal: object = { - title: "", - description: "", - subject_client_id: "", - substitute_client_id: "", -}; - -export const ClientUpdateProposal = { - encode( - message: ClientUpdateProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.subject_client_id !== "") { - writer.uint32(26).string(message.subject_client_id); - } - if (message.substitute_client_id !== "") { - writer.uint32(34).string(message.substitute_client_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientUpdateProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.subject_client_id = reader.string(); - break; - case 4: - message.substitute_client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = String(object.subject_client_id); - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = String(object.substitute_client_id); - } else { - message.substitute_client_id = ""; - } - return message; - }, - - toJSON(message: ClientUpdateProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.subject_client_id !== undefined && - (obj.subject_client_id = message.subject_client_id); - message.substitute_client_id !== undefined && - (obj.substitute_client_id = message.substitute_client_id); - return obj; - }, - - fromPartial(object: DeepPartial): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = object.subject_client_id; - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = object.substitute_client_id; - } else { - message.substitute_client_id = ""; - } - return message; - }, -}; - -const baseUpgradeProposal: object = { title: "", description: "" }; - -export const UpgradeProposal = { - encode(message: UpgradeProposal, writer: Writer = Writer.create()): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - if (message.upgraded_client_state !== undefined) { - Any.encode( - message.upgraded_client_state, - writer.uint32(34).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUpgradeProposal } as UpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgraded_client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromJSON( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, - - toJSON(message: UpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - message.upgraded_client_state !== undefined && - (obj.upgraded_client_state = message.upgraded_client_state - ? Any.toJSON(message.upgraded_client_state) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromPartial( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, -}; - -const baseHeight: object = { revision_number: 0, revision_height: 0 }; - -export const Height = { - encode(message: Height, writer: Writer = Writer.create()): Writer { - if (message.revision_number !== 0) { - writer.uint32(8).uint64(message.revision_number); - } - if (message.revision_height !== 0) { - writer.uint32(16).uint64(message.revision_height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Height { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeight } as Height; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revision_number = longToNumber(reader.uint64() as Long); - break; - case 2: - message.revision_height = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = Number(object.revision_number); - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = Number(object.revision_height); - } else { - message.revision_height = 0; - } - return message; - }, - - toJSON(message: Height): unknown { - const obj: any = {}; - message.revision_number !== undefined && - (obj.revision_number = message.revision_number); - message.revision_height !== undefined && - (obj.revision_height = message.revision_height); - return obj; - }, - - fromPartial(object: DeepPartial): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = object.revision_number; - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = object.revision_height; - } else { - message.revision_height = 0; - } - return message; - }, -}; - -const baseParams: object = { allowed_clients: "" }; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - for (const v of message.allowed_clients) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - message.allowed_clients = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowed_clients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(String(e)); - } - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - if (message.allowed_clients) { - obj.allowed_clients = message.allowed_clients.map((e) => e); - } else { - obj.allowed_clients = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(e); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/package.json b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/package.json deleted file mode 100644 index cf042f71..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "ibc-applications-transfer-v1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module ibc.applications.transfer.v1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/ibc-go/v2/modules/apps/transfer/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/vuex-root b/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.applications.transfer.v1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/index.ts deleted file mode 100644 index c13c088b..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/index.ts +++ /dev/null @@ -1,517 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { Channel } from "./module/types/ibc/core/channel/v1/channel" -import { IdentifiedChannel } from "./module/types/ibc/core/channel/v1/channel" -import { Counterparty } from "./module/types/ibc/core/channel/v1/channel" -import { Packet } from "./module/types/ibc/core/channel/v1/channel" -import { PacketState } from "./module/types/ibc/core/channel/v1/channel" -import { Acknowledgement } from "./module/types/ibc/core/channel/v1/channel" -import { PacketSequence } from "./module/types/ibc/core/channel/v1/genesis" - - -export { Channel, IdentifiedChannel, Counterparty, Packet, PacketState, Acknowledgement, PacketSequence }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Channel: {}, - Channels: {}, - ConnectionChannels: {}, - ChannelClientState: {}, - ChannelConsensusState: {}, - PacketCommitment: {}, - PacketCommitments: {}, - PacketReceipt: {}, - PacketAcknowledgement: {}, - PacketAcknowledgements: {}, - UnreceivedPackets: {}, - UnreceivedAcks: {}, - NextSequenceReceive: {}, - - _Structure: { - Channel: getStructure(Channel.fromPartial({})), - IdentifiedChannel: getStructure(IdentifiedChannel.fromPartial({})), - Counterparty: getStructure(Counterparty.fromPartial({})), - Packet: getStructure(Packet.fromPartial({})), - PacketState: getStructure(PacketState.fromPartial({})), - Acknowledgement: getStructure(Acknowledgement.fromPartial({})), - PacketSequence: getStructure(PacketSequence.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getChannel: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Channel[JSON.stringify(params)] ?? {} - }, - getChannels: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Channels[JSON.stringify(params)] ?? {} - }, - getConnectionChannels: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConnectionChannels[JSON.stringify(params)] ?? {} - }, - getChannelClientState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ChannelClientState[JSON.stringify(params)] ?? {} - }, - getChannelConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ChannelConsensusState[JSON.stringify(params)] ?? {} - }, - getPacketCommitment: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketCommitment[JSON.stringify(params)] ?? {} - }, - getPacketCommitments: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketCommitments[JSON.stringify(params)] ?? {} - }, - getPacketReceipt: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketReceipt[JSON.stringify(params)] ?? {} - }, - getPacketAcknowledgement: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketAcknowledgement[JSON.stringify(params)] ?? {} - }, - getPacketAcknowledgements: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketAcknowledgements[JSON.stringify(params)] ?? {} - }, - getUnreceivedPackets: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UnreceivedPackets[JSON.stringify(params)] ?? {} - }, - getUnreceivedAcks: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UnreceivedAcks[JSON.stringify(params)] ?? {} - }, - getNextSequenceReceive: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.NextSequenceReceive[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.core.channel.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryChannel({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryChannel( key.channel_id, key.port_id)).data - - - commit('QUERY', { query: 'Channel', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryChannel', payload: { options: { all }, params: {...key},query }}) - return getters['getChannel']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryChannel API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryChannels({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryChannels(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryChannels({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Channels', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryChannels', payload: { options: { all }, params: {...key},query }}) - return getters['getChannels']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryChannels API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConnectionChannels({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryConnectionChannels( key.connection, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryConnectionChannels( key.connection, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ConnectionChannels', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnectionChannels', payload: { options: { all }, params: {...key},query }}) - return getters['getConnectionChannels']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnectionChannels API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryChannelClientState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryChannelClientState( key.channel_id, key.port_id)).data - - - commit('QUERY', { query: 'ChannelClientState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryChannelClientState', payload: { options: { all }, params: {...key},query }}) - return getters['getChannelClientState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryChannelClientState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryChannelConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryChannelConsensusState( key.channel_id, key.port_id, key.revision_number, key.revision_height)).data - - - commit('QUERY', { query: 'ChannelConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryChannelConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getChannelConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryChannelConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketCommitment({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryPacketCommitment( key.channel_id, key.port_id, key.sequence)).data - - - commit('QUERY', { query: 'PacketCommitment', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketCommitment', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketCommitment']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketCommitment API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketCommitments({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryPacketCommitments( key.channel_id, key.port_id, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryPacketCommitments( key.channel_id, key.port_id, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'PacketCommitments', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketCommitments', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketCommitments']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketCommitments API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketReceipt({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryPacketReceipt( key.channel_id, key.port_id, key.sequence)).data - - - commit('QUERY', { query: 'PacketReceipt', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketReceipt', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketReceipt']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketReceipt API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketAcknowledgement({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryPacketAcknowledgement( key.channel_id, key.port_id, key.sequence)).data - - - commit('QUERY', { query: 'PacketAcknowledgement', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketAcknowledgement', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketAcknowledgement']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketAcknowledgement API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketAcknowledgements({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryPacketAcknowledgements( key.channel_id, key.port_id, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryPacketAcknowledgements( key.channel_id, key.port_id, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'PacketAcknowledgements', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketAcknowledgements', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketAcknowledgements']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketAcknowledgements API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUnreceivedPackets({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryUnreceivedPackets( key.channel_id, key.port_id, key.packet_commitment_sequences)).data - - - commit('QUERY', { query: 'UnreceivedPackets', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUnreceivedPackets', payload: { options: { all }, params: {...key},query }}) - return getters['getUnreceivedPackets']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUnreceivedPackets API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUnreceivedAcks({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryUnreceivedAcks( key.channel_id, key.port_id, key.packet_ack_sequences)).data - - - commit('QUERY', { query: 'UnreceivedAcks', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUnreceivedAcks', payload: { options: { all }, params: {...key},query }}) - return getters['getUnreceivedAcks']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUnreceivedAcks API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryNextSequenceReceive({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryNextSequenceReceive( key.channel_id, key.port_id)).data - - - commit('QUERY', { query: 'NextSequenceReceive', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryNextSequenceReceive', payload: { options: { all }, params: {...key},query }}) - return getters['getNextSequenceReceive']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryNextSequenceReceive API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/rest.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/rest.ts deleted file mode 100644 index 35e4f57f..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/rest.ts +++ /dev/null @@ -1,1344 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* Channel defines pipeline for exactly-once packet delivery between specific -modules on separate blockchains, which has at least one end capable of -sending packets and one end capable of receiving packets. -*/ -export interface V1Channel { - /** - * State defines if a channel is in one of the following states: - * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - * - * - STATE_UNINITIALIZED_UNSPECIFIED: Default State - * - STATE_INIT: A channel has just started the opening handshake. - * - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - * - STATE_OPEN: A channel has completed the handshake. Open channels are - * ready to send and receive packets. - * - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - * packets. - */ - state?: V1State; - - /** - * - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - * - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - * which they were sent. - * - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - */ - ordering?: V1Order; - counterparty?: V1Counterparty; - connection_hops?: string[]; - version?: string; -} - -export interface V1Counterparty { - /** port on the counterparty chain which owns the other end of the channel. */ - port_id?: string; - channel_id?: string; -} - -/** -* Normally the RevisionHeight is incremented at each height while keeping -RevisionNumber the same. However some consensus algorithms may choose to -reset the height in certain conditions e.g. hard forks, state-machine -breaking changes In these cases, the RevisionNumber is incremented so that -height continues to be monitonically increasing even as the RevisionHeight -gets reset -*/ -export interface V1Height { - /** @format uint64 */ - revision_number?: string; - - /** @format uint64 */ - revision_height?: string; -} - -/** -* IdentifiedChannel defines a channel with additional port and channel -identifier fields. -*/ -export interface V1IdentifiedChannel { - /** - * State defines if a channel is in one of the following states: - * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - * - * - STATE_UNINITIALIZED_UNSPECIFIED: Default State - * - STATE_INIT: A channel has just started the opening handshake. - * - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - * - STATE_OPEN: A channel has completed the handshake. Open channels are - * ready to send and receive packets. - * - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - * packets. - */ - state?: V1State; - - /** - * - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - * - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - * which they were sent. - * - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - */ - ordering?: V1Order; - counterparty?: V1Counterparty; - connection_hops?: string[]; - version?: string; - port_id?: string; - channel_id?: string; -} - -/** -* IdentifiedClientState defines a client state with an additional client -identifier field. -*/ -export interface V1IdentifiedClientState { - client_id?: string; - - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - client_state?: ProtobufAny; -} - -/** - * MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. - */ -export type V1MsgAcknowledgementResponse = object; - -/** -* MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response -type. -*/ -export type V1MsgChannelCloseConfirmResponse = object; - -/** - * MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. - */ -export type V1MsgChannelCloseInitResponse = object; - -/** - * MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. - */ -export type V1MsgChannelOpenAckResponse = object; - -/** -* MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response -type. -*/ -export type V1MsgChannelOpenConfirmResponse = object; - -/** - * MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. - */ -export type V1MsgChannelOpenInitResponse = object; - -/** - * MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. - */ -export type V1MsgChannelOpenTryResponse = object; - -/** - * MsgRecvPacketResponse defines the Msg/RecvPacket response type. - */ -export type V1MsgRecvPacketResponse = object; - -/** - * MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. - */ -export type V1MsgTimeoutOnCloseResponse = object; - -/** - * MsgTimeoutResponse defines the Msg/Timeout response type. - */ -export type V1MsgTimeoutResponse = object; - -/** -* - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in -which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent -*/ -export enum V1Order { - ORDER_NONE_UNSPECIFIED = "ORDER_NONE_UNSPECIFIED", - ORDER_UNORDERED = "ORDER_UNORDERED", - ORDER_ORDERED = "ORDER_ORDERED", -} - -export interface V1Packet { - /** - * number corresponds to the order of sends and receives, where a Packet - * with an earlier sequence number must be sent and received before a Packet - * with a later sequence number. - * @format uint64 - */ - sequence?: string; - - /** identifies the port on the sending chain. */ - source_port?: string; - - /** identifies the channel end on the sending chain. */ - source_channel?: string; - - /** identifies the port on the receiving chain. */ - destination_port?: string; - - /** identifies the channel end on the receiving chain. */ - destination_channel?: string; - - /** @format byte */ - data?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - timeout_height?: V1Height; - - /** @format uint64 */ - timeout_timestamp?: string; -} - -/** -* PacketState defines the generic type necessary to retrieve and store -packet commitments, acknowledgements, and receipts. -Caller is responsible for knowing the context necessary to interpret this -state as a commitment, acknowledgement, or a receipt. -*/ -export interface V1PacketState { - /** channel port identifier. */ - port_id?: string; - - /** channel unique identifier. */ - channel_id?: string; - - /** - * packet sequence. - * @format uint64 - */ - sequence?: string; - - /** - * embedded data that represents packet state. - * @format byte - */ - data?: string; -} - -export interface V1QueryChannelClientStateResponse { - /** - * IdentifiedClientState defines a client state with an additional client - * identifier field. - */ - identified_client_state?: V1IdentifiedClientState; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -export interface V1QueryChannelConsensusStateResponse { - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - consensus_state?: ProtobufAny; - client_id?: string; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -/** -* QueryChannelResponse is the response type for the Query/Channel RPC method. -Besides the Channel end, it includes a proof and the height from which the -proof was retrieved. -*/ -export interface V1QueryChannelResponse { - /** - * Channel defines pipeline for exactly-once packet delivery between specific - * modules on separate blockchains, which has at least one end capable of - * sending packets and one end capable of receiving packets. - */ - channel?: V1Channel; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -/** - * QueryChannelsResponse is the response type for the Query/Channels RPC method. - */ -export interface V1QueryChannelsResponse { - /** list of stored channels of the chain. */ - channels?: V1IdentifiedChannel[]; - - /** - * 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; - * } - */ - pagination?: V1Beta1PageResponse; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - height?: V1Height; -} - -export interface V1QueryConnectionChannelsResponse { - /** list of channels associated with a connection. */ - channels?: V1IdentifiedChannel[]; - - /** - * 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; - * } - */ - pagination?: V1Beta1PageResponse; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - height?: V1Height; -} - -export interface V1QueryNextSequenceReceiveResponse { - /** @format uint64 */ - next_sequence_receive?: string; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -export interface V1QueryPacketAcknowledgementResponse { - /** @format byte */ - acknowledgement?: string; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -export interface V1QueryPacketAcknowledgementsResponse { - acknowledgements?: V1PacketState[]; - - /** - * 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; - * } - */ - pagination?: V1Beta1PageResponse; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - height?: V1Height; -} - -export interface V1QueryPacketCommitmentResponse { - /** @format byte */ - commitment?: string; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -export interface V1QueryPacketCommitmentsResponse { - commitments?: V1PacketState[]; - - /** - * 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; - * } - */ - pagination?: V1Beta1PageResponse; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - height?: V1Height; -} - -export interface V1QueryPacketReceiptResponse { - received?: boolean; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -export interface V1QueryUnreceivedAcksResponse { - sequences?: string[]; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - height?: V1Height; -} - -export interface V1QueryUnreceivedPacketsResponse { - sequences?: string[]; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - height?: V1Height; -} - -/** -* State defines if a channel is in one of the following states: -CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are -ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive -packets. -*/ -export enum V1State { - STATE_UNINITIALIZED_UNSPECIFIED = "STATE_UNINITIALIZED_UNSPECIFIED", - STATE_INIT = "STATE_INIT", - STATE_TRYOPEN = "STATE_TRYOPEN", - STATE_OPEN = "STATE_OPEN", - STATE_CLOSED = "STATE_CLOSED", -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title ibc/core/channel/v1/channel.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryChannels - * @summary Channels queries all the IBC channels of a chain. - * @request GET:/ibc/core/channel/v1/channels - */ - queryChannels = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/channel/v1/channels`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryChannel - * @summary Channel queries an IBC Channel. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id} - */ - queryChannel = (channel_id: string, port_id: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryChannelClientState - * @summary ChannelClientState queries for the client state for the channel associated -with the provided channel identifiers. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/client_state - */ - queryChannelClientState = (channel_id: string, port_id: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/client_state`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryChannelConsensusState - * @summary ChannelConsensusState queries for the consensus state for the channel -associated with the provided channel identifiers. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height} - */ - queryChannelConsensusState = ( - channel_id: string, - port_id: string, - revision_number: string, - revision_height: string, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/consensus_state/revision/${revision_number}/height/${revision_height}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryNextSequenceReceive - * @summary NextSequenceReceive returns the next receive sequence for a given channel. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/next_sequence - */ - queryNextSequenceReceive = (channel_id: string, port_id: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/next_sequence`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryPacketAcknowledgements - * @summary PacketAcknowledgements returns all the packet acknowledgements associated -with a channel. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements - */ - queryPacketAcknowledgements = ( - channel_id: string, - port_id: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - packet_commitment_sequences?: string[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/packet_acknowledgements`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryPacketAcknowledgement - * @summary PacketAcknowledgement queries a stored packet acknowledgement hash. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence} - */ - queryPacketAcknowledgement = (channel_id: string, port_id: string, sequence: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/packet_acks/${sequence}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryPacketCommitments - * @summary PacketCommitments returns all the packet commitments hashes associated -with a channel. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments - */ - queryPacketCommitments = ( - channel_id: string, - port_id: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/packet_commitments`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryUnreceivedAcks - * @summary UnreceivedAcks returns all the unreceived IBC acknowledgements associated -with a channel and sequences. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks - */ - queryUnreceivedAcks = ( - channel_id: string, - port_id: string, - packet_ack_sequences: string[], - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/packet_commitments/${packet_ack_sequences}/unreceived_acks`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryUnreceivedPackets - * @summary UnreceivedPackets returns all the unreceived IBC packets associated with a -channel and sequences. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets - */ - queryUnreceivedPackets = ( - channel_id: string, - port_id: string, - packet_commitment_sequences: string[], - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/packet_commitments/${packet_commitment_sequences}/unreceived_packets`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryPacketCommitment - * @summary PacketCommitment queries a stored packet commitment hash. - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence} - */ - queryPacketCommitment = (channel_id: string, port_id: string, sequence: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/packet_commitments/${sequence}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryPacketReceipt - * @summary PacketReceipt queries if a given packet sequence has been received on the -queried chain - * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence} - */ - queryPacketReceipt = (channel_id: string, port_id: string, sequence: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/channel/v1/channels/${channel_id}/ports/${port_id}/packet_receipts/${sequence}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryConnectionChannels - * @summary ConnectionChannels queries all the channels associated with a connection -end. - * @request GET:/ibc/core/channel/v1/connections/{connection}/channels - */ - queryConnectionChannels = ( - connection: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/channel/v1/connections/${connection}/channels`, - method: "GET", - query: query, - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 0bc568f4..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,300 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { offset: 0, limit: 0, count_total: false }; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts deleted file mode 100644 index e9cefea2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts +++ /dev/null @@ -1,414 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.upgrade.v1beta1"; - -/** Plan specifies information about a planned upgrade and when it should occur. */ -export interface Plan { - /** - * Sets the name for the upgrade. This name will be used by the upgraded - * version of the software to apply any special "on-upgrade" commands during - * the first BeginBlock method after the upgrade is applied. It is also used - * to detect whether a software version can handle a given upgrade. If no - * upgrade handler with this name has been set in the software, it will be - * assumed that the software is out-of-date when the upgrade Time or Height is - * reached and the software will exit. - */ - name: string; - /** - * The time after which the upgrade must be performed. - * Leave set to its zero value to use a pre-defined Height instead. - */ - time: Date | undefined; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ - height: number; - /** - * Any application specific upgrade info to be included on-chain - * such as a git commit that validators could automatically upgrade to - */ - info: string; -} - -/** - * SoftwareUpgradeProposal is a gov Content type for initiating a software - * upgrade. - */ -export interface SoftwareUpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; -} - -/** - * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software - * upgrade. - */ -export interface CancelSoftwareUpgradeProposal { - title: string; - description: string; -} - -const basePlan: object = { name: "", height: 0, info: "" }; - -export const Plan = { - encode(message: Plan, writer: Writer = Writer.create()): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePlan } as Plan; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - return message; - }, - - toJSON(message: Plan): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.height !== undefined && (obj.height = message.height); - message.info !== undefined && (obj.info = message.info); - return obj; - }, - - fromPartial(object: DeepPartial): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - return message; - }, -}; - -const baseSoftwareUpgradeProposal: object = { title: "", description: "" }; - -export const SoftwareUpgradeProposal = { - encode( - message: SoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - return message; - }, - - toJSON(message: SoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - return message; - }, -}; - -const baseCancelSoftwareUpgradeProposal: object = { - title: "", - description: "", -}; - -export const CancelSoftwareUpgradeProposal = { - encode( - message: CancelSoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CancelSoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - return message; - }, - - toJSON(message: CancelSoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - return obj; - }, - - fromPartial( - object: DeepPartial - ): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/channel.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/channel.ts deleted file mode 100644 index 7ce43306..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/channel.ts +++ /dev/null @@ -1,1073 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Height } from "../../../../ibc/core/client/v1/client"; - -export const protobufPackage = "ibc.core.channel.v1"; - -/** - * State defines if a channel is in one of the following states: - * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - */ -export enum State { - /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ - STATE_UNINITIALIZED_UNSPECIFIED = 0, - /** STATE_INIT - A channel has just started the opening handshake. */ - STATE_INIT = 1, - /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */ - STATE_TRYOPEN = 2, - /** - * STATE_OPEN - A channel has completed the handshake. Open channels are - * ready to send and receive packets. - */ - STATE_OPEN = 3, - /** - * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive - * packets. - */ - STATE_CLOSED = 4, - UNRECOGNIZED = -1, -} - -export function stateFromJSON(object: any): State { - switch (object) { - case 0: - case "STATE_UNINITIALIZED_UNSPECIFIED": - return State.STATE_UNINITIALIZED_UNSPECIFIED; - case 1: - case "STATE_INIT": - return State.STATE_INIT; - case 2: - case "STATE_TRYOPEN": - return State.STATE_TRYOPEN; - case 3: - case "STATE_OPEN": - return State.STATE_OPEN; - case 4: - case "STATE_CLOSED": - return State.STATE_CLOSED; - case -1: - case "UNRECOGNIZED": - default: - return State.UNRECOGNIZED; - } -} - -export function stateToJSON(object: State): string { - switch (object) { - case State.STATE_UNINITIALIZED_UNSPECIFIED: - return "STATE_UNINITIALIZED_UNSPECIFIED"; - case State.STATE_INIT: - return "STATE_INIT"; - case State.STATE_TRYOPEN: - return "STATE_TRYOPEN"; - case State.STATE_OPEN: - return "STATE_OPEN"; - case State.STATE_CLOSED: - return "STATE_CLOSED"; - default: - return "UNKNOWN"; - } -} - -/** Order defines if a channel is ORDERED or UNORDERED */ -export enum Order { - /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */ - ORDER_NONE_UNSPECIFIED = 0, - /** - * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in - * which they were sent. - */ - ORDER_UNORDERED = 1, - /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */ - ORDER_ORDERED = 2, - UNRECOGNIZED = -1, -} - -export function orderFromJSON(object: any): Order { - switch (object) { - case 0: - case "ORDER_NONE_UNSPECIFIED": - return Order.ORDER_NONE_UNSPECIFIED; - case 1: - case "ORDER_UNORDERED": - return Order.ORDER_UNORDERED; - case 2: - case "ORDER_ORDERED": - return Order.ORDER_ORDERED; - case -1: - case "UNRECOGNIZED": - default: - return Order.UNRECOGNIZED; - } -} - -export function orderToJSON(object: Order): string { - switch (object) { - case Order.ORDER_NONE_UNSPECIFIED: - return "ORDER_NONE_UNSPECIFIED"; - case Order.ORDER_UNORDERED: - return "ORDER_UNORDERED"; - case Order.ORDER_ORDERED: - return "ORDER_ORDERED"; - default: - return "UNKNOWN"; - } -} - -/** - * Channel defines pipeline for exactly-once packet delivery between specific - * modules on separate blockchains, which has at least one end capable of - * sending packets and one end capable of receiving packets. - */ -export interface Channel { - /** current state of the channel end */ - state: State; - /** whether the channel is ordered or unordered */ - ordering: Order; - /** counterparty channel end */ - counterparty: Counterparty | undefined; - /** - * list of connection identifiers, in order, along which packets sent on - * this channel will travel - */ - connection_hops: string[]; - /** opaque channel version, which is agreed upon during the handshake */ - version: string; -} - -/** - * IdentifiedChannel defines a channel with additional port and channel - * identifier fields. - */ -export interface IdentifiedChannel { - /** current state of the channel end */ - state: State; - /** whether the channel is ordered or unordered */ - ordering: Order; - /** counterparty channel end */ - counterparty: Counterparty | undefined; - /** - * list of connection identifiers, in order, along which packets sent on - * this channel will travel - */ - connection_hops: string[]; - /** opaque channel version, which is agreed upon during the handshake */ - version: string; - /** port identifier */ - port_id: string; - /** channel identifier */ - channel_id: string; -} - -/** Counterparty defines a channel end counterparty */ -export interface Counterparty { - /** port on the counterparty chain which owns the other end of the channel. */ - port_id: string; - /** channel end on the counterparty chain */ - channel_id: string; -} - -/** Packet defines a type that carries data across different chains through IBC */ -export interface Packet { - /** - * number corresponds to the order of sends and receives, where a Packet - * with an earlier sequence number must be sent and received before a Packet - * with a later sequence number. - */ - sequence: number; - /** identifies the port on the sending chain. */ - source_port: string; - /** identifies the channel end on the sending chain. */ - source_channel: string; - /** identifies the port on the receiving chain. */ - destination_port: string; - /** identifies the channel end on the receiving chain. */ - destination_channel: string; - /** actual opaque bytes transferred directly to the application module */ - data: Uint8Array; - /** block height after which the packet times out */ - timeout_height: Height | undefined; - /** block timestamp (in nanoseconds) after which the packet times out */ - timeout_timestamp: number; -} - -/** - * PacketState defines the generic type necessary to retrieve and store - * packet commitments, acknowledgements, and receipts. - * Caller is responsible for knowing the context necessary to interpret this - * state as a commitment, acknowledgement, or a receipt. - */ -export interface PacketState { - /** channel port identifier. */ - port_id: string; - /** channel unique identifier. */ - channel_id: string; - /** packet sequence. */ - sequence: number; - /** embedded data that represents packet state. */ - data: Uint8Array; -} - -/** - * Acknowledgement is the recommended acknowledgement format to be used by - * app-specific protocols. - * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental - * conflicts with other protobuf message formats used for acknowledgements. - * The first byte of any message with this format will be the non-ASCII values - * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: - * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope - */ -export interface Acknowledgement { - result: Uint8Array | undefined; - error: string | undefined; -} - -const baseChannel: object = { - state: 0, - ordering: 0, - connection_hops: "", - version: "", -}; - -export const Channel = { - encode(message: Channel, writer: Writer = Writer.create()): Writer { - if (message.state !== 0) { - writer.uint32(8).int32(message.state); - } - if (message.ordering !== 0) { - writer.uint32(16).int32(message.ordering); - } - if (message.counterparty !== undefined) { - Counterparty.encode( - message.counterparty, - writer.uint32(26).fork() - ).ldelim(); - } - for (const v of message.connection_hops) { - writer.uint32(34).string(v!); - } - if (message.version !== "") { - writer.uint32(42).string(message.version); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Channel { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseChannel } as Channel; - message.connection_hops = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32() as any; - break; - case 2: - message.ordering = reader.int32() as any; - break; - case 3: - message.counterparty = Counterparty.decode(reader, reader.uint32()); - break; - case 4: - message.connection_hops.push(reader.string()); - break; - case 5: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Channel { - const message = { ...baseChannel } as Channel; - message.connection_hops = []; - if (object.state !== undefined && object.state !== null) { - message.state = stateFromJSON(object.state); - } else { - message.state = 0; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = orderFromJSON(object.ordering); - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromJSON(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.connection_hops !== undefined && - object.connection_hops !== null - ) { - for (const e of object.connection_hops) { - message.connection_hops.push(String(e)); - } - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - return message; - }, - - toJSON(message: Channel): unknown { - const obj: any = {}; - message.state !== undefined && (obj.state = stateToJSON(message.state)); - message.ordering !== undefined && - (obj.ordering = orderToJSON(message.ordering)); - message.counterparty !== undefined && - (obj.counterparty = message.counterparty - ? Counterparty.toJSON(message.counterparty) - : undefined); - if (message.connection_hops) { - obj.connection_hops = message.connection_hops.map((e) => e); - } else { - obj.connection_hops = []; - } - message.version !== undefined && (obj.version = message.version); - return obj; - }, - - fromPartial(object: DeepPartial): Channel { - const message = { ...baseChannel } as Channel; - message.connection_hops = []; - if (object.state !== undefined && object.state !== null) { - message.state = object.state; - } else { - message.state = 0; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = object.ordering; - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromPartial(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.connection_hops !== undefined && - object.connection_hops !== null - ) { - for (const e of object.connection_hops) { - message.connection_hops.push(e); - } - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - return message; - }, -}; - -const baseIdentifiedChannel: object = { - state: 0, - ordering: 0, - connection_hops: "", - version: "", - port_id: "", - channel_id: "", -}; - -export const IdentifiedChannel = { - encode(message: IdentifiedChannel, writer: Writer = Writer.create()): Writer { - if (message.state !== 0) { - writer.uint32(8).int32(message.state); - } - if (message.ordering !== 0) { - writer.uint32(16).int32(message.ordering); - } - if (message.counterparty !== undefined) { - Counterparty.encode( - message.counterparty, - writer.uint32(26).fork() - ).ldelim(); - } - for (const v of message.connection_hops) { - writer.uint32(34).string(v!); - } - if (message.version !== "") { - writer.uint32(42).string(message.version); - } - if (message.port_id !== "") { - writer.uint32(50).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(58).string(message.channel_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IdentifiedChannel { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIdentifiedChannel } as IdentifiedChannel; - message.connection_hops = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32() as any; - break; - case 2: - message.ordering = reader.int32() as any; - break; - case 3: - message.counterparty = Counterparty.decode(reader, reader.uint32()); - break; - case 4: - message.connection_hops.push(reader.string()); - break; - case 5: - message.version = reader.string(); - break; - case 6: - message.port_id = reader.string(); - break; - case 7: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IdentifiedChannel { - const message = { ...baseIdentifiedChannel } as IdentifiedChannel; - message.connection_hops = []; - if (object.state !== undefined && object.state !== null) { - message.state = stateFromJSON(object.state); - } else { - message.state = 0; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = orderFromJSON(object.ordering); - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromJSON(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.connection_hops !== undefined && - object.connection_hops !== null - ) { - for (const e of object.connection_hops) { - message.connection_hops.push(String(e)); - } - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - return message; - }, - - toJSON(message: IdentifiedChannel): unknown { - const obj: any = {}; - message.state !== undefined && (obj.state = stateToJSON(message.state)); - message.ordering !== undefined && - (obj.ordering = orderToJSON(message.ordering)); - message.counterparty !== undefined && - (obj.counterparty = message.counterparty - ? Counterparty.toJSON(message.counterparty) - : undefined); - if (message.connection_hops) { - obj.connection_hops = message.connection_hops.map((e) => e); - } else { - obj.connection_hops = []; - } - message.version !== undefined && (obj.version = message.version); - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - return obj; - }, - - fromPartial(object: DeepPartial): IdentifiedChannel { - const message = { ...baseIdentifiedChannel } as IdentifiedChannel; - message.connection_hops = []; - if (object.state !== undefined && object.state !== null) { - message.state = object.state; - } else { - message.state = 0; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = object.ordering; - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromPartial(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.connection_hops !== undefined && - object.connection_hops !== null - ) { - for (const e of object.connection_hops) { - message.connection_hops.push(e); - } - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - return message; - }, -}; - -const baseCounterparty: object = { port_id: "", channel_id: "" }; - -export const Counterparty = { - encode(message: Counterparty, writer: Writer = Writer.create()): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Counterparty { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCounterparty } as Counterparty; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Counterparty { - const message = { ...baseCounterparty } as Counterparty; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - return message; - }, - - toJSON(message: Counterparty): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - return obj; - }, - - fromPartial(object: DeepPartial): Counterparty { - const message = { ...baseCounterparty } as Counterparty; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - return message; - }, -}; - -const basePacket: object = { - sequence: 0, - source_port: "", - source_channel: "", - destination_port: "", - destination_channel: "", - timeout_timestamp: 0, -}; - -export const Packet = { - encode(message: Packet, writer: Writer = Writer.create()): Writer { - if (message.sequence !== 0) { - writer.uint32(8).uint64(message.sequence); - } - if (message.source_port !== "") { - writer.uint32(18).string(message.source_port); - } - if (message.source_channel !== "") { - writer.uint32(26).string(message.source_channel); - } - if (message.destination_port !== "") { - writer.uint32(34).string(message.destination_port); - } - if (message.destination_channel !== "") { - writer.uint32(42).string(message.destination_channel); - } - if (message.data.length !== 0) { - writer.uint32(50).bytes(message.data); - } - if (message.timeout_height !== undefined) { - Height.encode(message.timeout_height, writer.uint32(58).fork()).ldelim(); - } - if (message.timeout_timestamp !== 0) { - writer.uint32(64).uint64(message.timeout_timestamp); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Packet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePacket } as Packet; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = longToNumber(reader.uint64() as Long); - break; - case 2: - message.source_port = reader.string(); - break; - case 3: - message.source_channel = reader.string(); - break; - case 4: - message.destination_port = reader.string(); - break; - case 5: - message.destination_channel = reader.string(); - break; - case 6: - message.data = reader.bytes(); - break; - case 7: - message.timeout_height = Height.decode(reader, reader.uint32()); - break; - case 8: - message.timeout_timestamp = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Packet { - const message = { ...basePacket } as Packet; - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - if (object.source_port !== undefined && object.source_port !== null) { - message.source_port = String(object.source_port); - } else { - message.source_port = ""; - } - if (object.source_channel !== undefined && object.source_channel !== null) { - message.source_channel = String(object.source_channel); - } else { - message.source_channel = ""; - } - if ( - object.destination_port !== undefined && - object.destination_port !== null - ) { - message.destination_port = String(object.destination_port); - } else { - message.destination_port = ""; - } - if ( - object.destination_channel !== undefined && - object.destination_channel !== null - ) { - message.destination_channel = String(object.destination_channel); - } else { - message.destination_channel = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = Height.fromJSON(object.timeout_height); - } else { - message.timeout_height = undefined; - } - if ( - object.timeout_timestamp !== undefined && - object.timeout_timestamp !== null - ) { - message.timeout_timestamp = Number(object.timeout_timestamp); - } else { - message.timeout_timestamp = 0; - } - return message; - }, - - toJSON(message: Packet): unknown { - const obj: any = {}; - message.sequence !== undefined && (obj.sequence = message.sequence); - message.source_port !== undefined && - (obj.source_port = message.source_port); - message.source_channel !== undefined && - (obj.source_channel = message.source_channel); - message.destination_port !== undefined && - (obj.destination_port = message.destination_port); - message.destination_channel !== undefined && - (obj.destination_channel = message.destination_channel); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.timeout_height !== undefined && - (obj.timeout_height = message.timeout_height - ? Height.toJSON(message.timeout_height) - : undefined); - message.timeout_timestamp !== undefined && - (obj.timeout_timestamp = message.timeout_timestamp); - return obj; - }, - - fromPartial(object: DeepPartial): Packet { - const message = { ...basePacket } as Packet; - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - if (object.source_port !== undefined && object.source_port !== null) { - message.source_port = object.source_port; - } else { - message.source_port = ""; - } - if (object.source_channel !== undefined && object.source_channel !== null) { - message.source_channel = object.source_channel; - } else { - message.source_channel = ""; - } - if ( - object.destination_port !== undefined && - object.destination_port !== null - ) { - message.destination_port = object.destination_port; - } else { - message.destination_port = ""; - } - if ( - object.destination_channel !== undefined && - object.destination_channel !== null - ) { - message.destination_channel = object.destination_channel; - } else { - message.destination_channel = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = Height.fromPartial(object.timeout_height); - } else { - message.timeout_height = undefined; - } - if ( - object.timeout_timestamp !== undefined && - object.timeout_timestamp !== null - ) { - message.timeout_timestamp = object.timeout_timestamp; - } else { - message.timeout_timestamp = 0; - } - return message; - }, -}; - -const basePacketState: object = { port_id: "", channel_id: "", sequence: 0 }; - -export const PacketState = { - encode(message: PacketState, writer: Writer = Writer.create()): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.sequence !== 0) { - writer.uint32(24).uint64(message.sequence); - } - if (message.data.length !== 0) { - writer.uint32(34).bytes(message.data); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PacketState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePacketState } as PacketState; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = longToNumber(reader.uint64() as Long); - break; - case 4: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PacketState { - const message = { ...basePacketState } as PacketState; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - toJSON(message: PacketState): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.sequence !== undefined && (obj.sequence = message.sequence); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): PacketState { - const message = { ...basePacketState } as PacketState; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, -}; - -const baseAcknowledgement: object = {}; - -export const Acknowledgement = { - encode(message: Acknowledgement, writer: Writer = Writer.create()): Writer { - if (message.result !== undefined) { - writer.uint32(170).bytes(message.result); - } - if (message.error !== undefined) { - writer.uint32(178).string(message.error); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Acknowledgement { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAcknowledgement } as Acknowledgement; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 21: - message.result = reader.bytes(); - break; - case 22: - message.error = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Acknowledgement { - const message = { ...baseAcknowledgement } as Acknowledgement; - if (object.result !== undefined && object.result !== null) { - message.result = bytesFromBase64(object.result); - } - if (object.error !== undefined && object.error !== null) { - message.error = String(object.error); - } else { - message.error = undefined; - } - return message; - }, - - toJSON(message: Acknowledgement): unknown { - const obj: any = {}; - message.result !== undefined && - (obj.result = - message.result !== undefined - ? base64FromBytes(message.result) - : undefined); - message.error !== undefined && (obj.error = message.error); - return obj; - }, - - fromPartial(object: DeepPartial): Acknowledgement { - const message = { ...baseAcknowledgement } as Acknowledgement; - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } else { - message.result = undefined; - } - if (object.error !== undefined && object.error !== null) { - message.error = object.error; - } else { - message.error = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/genesis.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/genesis.ts deleted file mode 100644 index 2c2fa94a..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/genesis.ts +++ /dev/null @@ -1,414 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - IdentifiedChannel, - PacketState, -} from "../../../../ibc/core/channel/v1/channel"; - -export const protobufPackage = "ibc.core.channel.v1"; - -/** GenesisState defines the ibc channel submodule's genesis state. */ -export interface GenesisState { - channels: IdentifiedChannel[]; - acknowledgements: PacketState[]; - commitments: PacketState[]; - receipts: PacketState[]; - send_sequences: PacketSequence[]; - recv_sequences: PacketSequence[]; - ack_sequences: PacketSequence[]; - /** the sequence for the next generated channel identifier */ - next_channel_sequence: number; -} - -/** - * PacketSequence defines the genesis type necessary to retrieve and store - * next send and receive sequences. - */ -export interface PacketSequence { - port_id: string; - channel_id: string; - sequence: number; -} - -const baseGenesisState: object = { next_channel_sequence: 0 }; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - for (const v of message.channels) { - IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.acknowledgements) { - PacketState.encode(v!, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.commitments) { - PacketState.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.receipts) { - PacketState.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.send_sequences) { - PacketSequence.encode(v!, writer.uint32(42).fork()).ldelim(); - } - for (const v of message.recv_sequences) { - PacketSequence.encode(v!, writer.uint32(50).fork()).ldelim(); - } - for (const v of message.ack_sequences) { - PacketSequence.encode(v!, writer.uint32(58).fork()).ldelim(); - } - if (message.next_channel_sequence !== 0) { - writer.uint32(64).uint64(message.next_channel_sequence); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.channels = []; - message.acknowledgements = []; - message.commitments = []; - message.receipts = []; - message.send_sequences = []; - message.recv_sequences = []; - message.ack_sequences = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channels.push( - IdentifiedChannel.decode(reader, reader.uint32()) - ); - break; - case 2: - message.acknowledgements.push( - PacketState.decode(reader, reader.uint32()) - ); - break; - case 3: - message.commitments.push(PacketState.decode(reader, reader.uint32())); - break; - case 4: - message.receipts.push(PacketState.decode(reader, reader.uint32())); - break; - case 5: - message.send_sequences.push( - PacketSequence.decode(reader, reader.uint32()) - ); - break; - case 6: - message.recv_sequences.push( - PacketSequence.decode(reader, reader.uint32()) - ); - break; - case 7: - message.ack_sequences.push( - PacketSequence.decode(reader, reader.uint32()) - ); - break; - case 8: - message.next_channel_sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.channels = []; - message.acknowledgements = []; - message.commitments = []; - message.receipts = []; - message.send_sequences = []; - message.recv_sequences = []; - message.ack_sequences = []; - if (object.channels !== undefined && object.channels !== null) { - for (const e of object.channels) { - message.channels.push(IdentifiedChannel.fromJSON(e)); - } - } - if ( - object.acknowledgements !== undefined && - object.acknowledgements !== null - ) { - for (const e of object.acknowledgements) { - message.acknowledgements.push(PacketState.fromJSON(e)); - } - } - if (object.commitments !== undefined && object.commitments !== null) { - for (const e of object.commitments) { - message.commitments.push(PacketState.fromJSON(e)); - } - } - if (object.receipts !== undefined && object.receipts !== null) { - for (const e of object.receipts) { - message.receipts.push(PacketState.fromJSON(e)); - } - } - if (object.send_sequences !== undefined && object.send_sequences !== null) { - for (const e of object.send_sequences) { - message.send_sequences.push(PacketSequence.fromJSON(e)); - } - } - if (object.recv_sequences !== undefined && object.recv_sequences !== null) { - for (const e of object.recv_sequences) { - message.recv_sequences.push(PacketSequence.fromJSON(e)); - } - } - if (object.ack_sequences !== undefined && object.ack_sequences !== null) { - for (const e of object.ack_sequences) { - message.ack_sequences.push(PacketSequence.fromJSON(e)); - } - } - if ( - object.next_channel_sequence !== undefined && - object.next_channel_sequence !== null - ) { - message.next_channel_sequence = Number(object.next_channel_sequence); - } else { - message.next_channel_sequence = 0; - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.channels) { - obj.channels = message.channels.map((e) => - e ? IdentifiedChannel.toJSON(e) : undefined - ); - } else { - obj.channels = []; - } - if (message.acknowledgements) { - obj.acknowledgements = message.acknowledgements.map((e) => - e ? PacketState.toJSON(e) : undefined - ); - } else { - obj.acknowledgements = []; - } - if (message.commitments) { - obj.commitments = message.commitments.map((e) => - e ? PacketState.toJSON(e) : undefined - ); - } else { - obj.commitments = []; - } - if (message.receipts) { - obj.receipts = message.receipts.map((e) => - e ? PacketState.toJSON(e) : undefined - ); - } else { - obj.receipts = []; - } - if (message.send_sequences) { - obj.send_sequences = message.send_sequences.map((e) => - e ? PacketSequence.toJSON(e) : undefined - ); - } else { - obj.send_sequences = []; - } - if (message.recv_sequences) { - obj.recv_sequences = message.recv_sequences.map((e) => - e ? PacketSequence.toJSON(e) : undefined - ); - } else { - obj.recv_sequences = []; - } - if (message.ack_sequences) { - obj.ack_sequences = message.ack_sequences.map((e) => - e ? PacketSequence.toJSON(e) : undefined - ); - } else { - obj.ack_sequences = []; - } - message.next_channel_sequence !== undefined && - (obj.next_channel_sequence = message.next_channel_sequence); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.channels = []; - message.acknowledgements = []; - message.commitments = []; - message.receipts = []; - message.send_sequences = []; - message.recv_sequences = []; - message.ack_sequences = []; - if (object.channels !== undefined && object.channels !== null) { - for (const e of object.channels) { - message.channels.push(IdentifiedChannel.fromPartial(e)); - } - } - if ( - object.acknowledgements !== undefined && - object.acknowledgements !== null - ) { - for (const e of object.acknowledgements) { - message.acknowledgements.push(PacketState.fromPartial(e)); - } - } - if (object.commitments !== undefined && object.commitments !== null) { - for (const e of object.commitments) { - message.commitments.push(PacketState.fromPartial(e)); - } - } - if (object.receipts !== undefined && object.receipts !== null) { - for (const e of object.receipts) { - message.receipts.push(PacketState.fromPartial(e)); - } - } - if (object.send_sequences !== undefined && object.send_sequences !== null) { - for (const e of object.send_sequences) { - message.send_sequences.push(PacketSequence.fromPartial(e)); - } - } - if (object.recv_sequences !== undefined && object.recv_sequences !== null) { - for (const e of object.recv_sequences) { - message.recv_sequences.push(PacketSequence.fromPartial(e)); - } - } - if (object.ack_sequences !== undefined && object.ack_sequences !== null) { - for (const e of object.ack_sequences) { - message.ack_sequences.push(PacketSequence.fromPartial(e)); - } - } - if ( - object.next_channel_sequence !== undefined && - object.next_channel_sequence !== null - ) { - message.next_channel_sequence = object.next_channel_sequence; - } else { - message.next_channel_sequence = 0; - } - return message; - }, -}; - -const basePacketSequence: object = { port_id: "", channel_id: "", sequence: 0 }; - -export const PacketSequence = { - encode(message: PacketSequence, writer: Writer = Writer.create()): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.sequence !== 0) { - writer.uint32(24).uint64(message.sequence); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PacketSequence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePacketSequence } as PacketSequence; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PacketSequence { - const message = { ...basePacketSequence } as PacketSequence; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; - }, - - toJSON(message: PacketSequence): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.sequence !== undefined && (obj.sequence = message.sequence); - return obj; - }, - - fromPartial(object: DeepPartial): PacketSequence { - const message = { ...basePacketSequence } as PacketSequence; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/query.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/query.ts deleted file mode 100644 index b31f2787..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/query.ts +++ /dev/null @@ -1,3549 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - Channel, - IdentifiedChannel, - PacketState, -} from "../../../../ibc/core/channel/v1/channel"; -import { - Height, - IdentifiedClientState, -} from "../../../../ibc/core/client/v1/client"; -import { - PageRequest, - PageResponse, -} from "../../../../cosmos/base/query/v1beta1/pagination"; -import { Any } from "../../../../google/protobuf/any"; - -export const protobufPackage = "ibc.core.channel.v1"; - -/** QueryChannelRequest is the request type for the Query/Channel RPC method */ -export interface QueryChannelRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; -} - -/** - * QueryChannelResponse is the response type for the Query/Channel RPC method. - * Besides the Channel end, it includes a proof and the height from which the - * proof was retrieved. - */ -export interface QueryChannelResponse { - /** channel associated with the request identifiers */ - channel: Channel | undefined; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** QueryChannelsRequest is the request type for the Query/Channels RPC method */ -export interface QueryChannelsRequest { - /** pagination request */ - pagination: PageRequest | undefined; -} - -/** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ -export interface QueryChannelsResponse { - /** list of stored channels of the chain. */ - channels: IdentifiedChannel[]; - /** pagination response */ - pagination: PageResponse | undefined; - /** query block height */ - height: Height | undefined; -} - -/** - * QueryConnectionChannelsRequest is the request type for the - * Query/QueryConnectionChannels RPC method - */ -export interface QueryConnectionChannelsRequest { - /** connection unique identifier */ - connection: string; - /** pagination request */ - pagination: PageRequest | undefined; -} - -/** - * QueryConnectionChannelsResponse is the Response type for the - * Query/QueryConnectionChannels RPC method - */ -export interface QueryConnectionChannelsResponse { - /** list of channels associated with a connection. */ - channels: IdentifiedChannel[]; - /** pagination response */ - pagination: PageResponse | undefined; - /** query block height */ - height: Height | undefined; -} - -/** - * QueryChannelClientStateRequest is the request type for the Query/ClientState - * RPC method - */ -export interface QueryChannelClientStateRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; -} - -/** - * QueryChannelClientStateResponse is the Response type for the - * Query/QueryChannelClientState RPC method - */ -export interface QueryChannelClientStateResponse { - /** client state associated with the channel */ - identified_client_state: IdentifiedClientState | undefined; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** - * QueryChannelConsensusStateRequest is the request type for the - * Query/ConsensusState RPC method - */ -export interface QueryChannelConsensusStateRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; - /** revision number of the consensus state */ - revision_number: number; - /** revision height of the consensus state */ - revision_height: number; -} - -/** - * QueryChannelClientStateResponse is the Response type for the - * Query/QueryChannelClientState RPC method - */ -export interface QueryChannelConsensusStateResponse { - /** consensus state associated with the channel */ - consensus_state: Any | undefined; - /** client ID associated with the consensus state */ - client_id: string; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** - * QueryPacketCommitmentRequest is the request type for the - * Query/PacketCommitment RPC method - */ -export interface QueryPacketCommitmentRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; - /** packet sequence */ - sequence: number; -} - -/** - * QueryPacketCommitmentResponse defines the client query response for a packet - * which also includes a proof and the height from which the proof was - * retrieved - */ -export interface QueryPacketCommitmentResponse { - /** packet associated with the request fields */ - commitment: Uint8Array; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** - * QueryPacketCommitmentsRequest is the request type for the - * Query/QueryPacketCommitments RPC method - */ -export interface QueryPacketCommitmentsRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; - /** pagination request */ - pagination: PageRequest | undefined; -} - -/** - * QueryPacketCommitmentsResponse is the request type for the - * Query/QueryPacketCommitments RPC method - */ -export interface QueryPacketCommitmentsResponse { - commitments: PacketState[]; - /** pagination response */ - pagination: PageResponse | undefined; - /** query block height */ - height: Height | undefined; -} - -/** - * QueryPacketReceiptRequest is the request type for the - * Query/PacketReceipt RPC method - */ -export interface QueryPacketReceiptRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; - /** packet sequence */ - sequence: number; -} - -/** - * QueryPacketReceiptResponse defines the client query response for a packet - * receipt which also includes a proof, and the height from which the proof was - * retrieved - */ -export interface QueryPacketReceiptResponse { - /** success flag for if receipt exists */ - received: boolean; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** - * QueryPacketAcknowledgementRequest is the request type for the - * Query/PacketAcknowledgement RPC method - */ -export interface QueryPacketAcknowledgementRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; - /** packet sequence */ - sequence: number; -} - -/** - * QueryPacketAcknowledgementResponse defines the client query response for a - * packet which also includes a proof and the height from which the - * proof was retrieved - */ -export interface QueryPacketAcknowledgementResponse { - /** packet associated with the request fields */ - acknowledgement: Uint8Array; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** - * QueryPacketAcknowledgementsRequest is the request type for the - * Query/QueryPacketCommitments RPC method - */ -export interface QueryPacketAcknowledgementsRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; - /** pagination request */ - pagination: PageRequest | undefined; - /** list of packet sequences */ - packet_commitment_sequences: number[]; -} - -/** - * QueryPacketAcknowledgemetsResponse is the request type for the - * Query/QueryPacketAcknowledgements RPC method - */ -export interface QueryPacketAcknowledgementsResponse { - acknowledgements: PacketState[]; - /** pagination response */ - pagination: PageResponse | undefined; - /** query block height */ - height: Height | undefined; -} - -/** - * QueryUnreceivedPacketsRequest is the request type for the - * Query/UnreceivedPackets RPC method - */ -export interface QueryUnreceivedPacketsRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; - /** list of packet sequences */ - packet_commitment_sequences: number[]; -} - -/** - * QueryUnreceivedPacketsResponse is the response type for the - * Query/UnreceivedPacketCommitments RPC method - */ -export interface QueryUnreceivedPacketsResponse { - /** list of unreceived packet sequences */ - sequences: number[]; - /** query block height */ - height: Height | undefined; -} - -/** - * QueryUnreceivedAcks is the request type for the - * Query/UnreceivedAcks RPC method - */ -export interface QueryUnreceivedAcksRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; - /** list of acknowledgement sequences */ - packet_ack_sequences: number[]; -} - -/** - * QueryUnreceivedAcksResponse is the response type for the - * Query/UnreceivedAcks RPC method - */ -export interface QueryUnreceivedAcksResponse { - /** list of unreceived acknowledgement sequences */ - sequences: number[]; - /** query block height */ - height: Height | undefined; -} - -/** - * QueryNextSequenceReceiveRequest is the request type for the - * Query/QueryNextSequenceReceiveRequest RPC method - */ -export interface QueryNextSequenceReceiveRequest { - /** port unique identifier */ - port_id: string; - /** channel unique identifier */ - channel_id: string; -} - -/** - * QuerySequenceResponse is the request type for the - * Query/QueryNextSequenceReceiveResponse RPC method - */ -export interface QueryNextSequenceReceiveResponse { - /** next sequence receive number */ - next_sequence_receive: number; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -const baseQueryChannelRequest: object = { port_id: "", channel_id: "" }; - -export const QueryChannelRequest = { - encode( - message: QueryChannelRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryChannelRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryChannelRequest } as QueryChannelRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryChannelRequest { - const message = { ...baseQueryChannelRequest } as QueryChannelRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - return message; - }, - - toJSON(message: QueryChannelRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - return obj; - }, - - fromPartial(object: DeepPartial): QueryChannelRequest { - const message = { ...baseQueryChannelRequest } as QueryChannelRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - return message; - }, -}; - -const baseQueryChannelResponse: object = {}; - -export const QueryChannelResponse = { - encode( - message: QueryChannelResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.channel !== undefined) { - Channel.encode(message.channel, writer.uint32(10).fork()).ldelim(); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryChannelResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryChannelResponse } as QueryChannelResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel = Channel.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryChannelResponse { - const message = { ...baseQueryChannelResponse } as QueryChannelResponse; - if (object.channel !== undefined && object.channel !== null) { - message.channel = Channel.fromJSON(object.channel); - } else { - message.channel = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryChannelResponse): unknown { - const obj: any = {}; - message.channel !== undefined && - (obj.channel = message.channel - ? Channel.toJSON(message.channel) - : undefined); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryChannelResponse { - const message = { ...baseQueryChannelResponse } as QueryChannelResponse; - if (object.channel !== undefined && object.channel !== null) { - message.channel = Channel.fromPartial(object.channel); - } else { - message.channel = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryChannelsRequest: object = {}; - -export const QueryChannelsRequest = { - encode( - message: QueryChannelsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryChannelsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; - 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): QueryChannelsRequest { - const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryChannelsRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryChannelsRequest { - const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryChannelsResponse: object = {}; - -export const QueryChannelsResponse = { - encode( - message: QueryChannelsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.channels) { - IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryChannelsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; - message.channels = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channels.push( - IdentifiedChannel.decode(reader, reader.uint32()) - ); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryChannelsResponse { - const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; - message.channels = []; - if (object.channels !== undefined && object.channels !== null) { - for (const e of object.channels) { - message.channels.push(IdentifiedChannel.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - return message; - }, - - toJSON(message: QueryChannelsResponse): unknown { - const obj: any = {}; - if (message.channels) { - obj.channels = message.channels.map((e) => - e ? IdentifiedChannel.toJSON(e) : undefined - ); - } else { - obj.channels = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryChannelsResponse { - const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; - message.channels = []; - if (object.channels !== undefined && object.channels !== null) { - for (const e of object.channels) { - message.channels.push(IdentifiedChannel.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - return message; - }, -}; - -const baseQueryConnectionChannelsRequest: object = { connection: "" }; - -export const QueryConnectionChannelsRequest = { - encode( - message: QueryConnectionChannelsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.connection !== "") { - writer.uint32(10).string(message.connection); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConnectionChannelsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConnectionChannelsRequest, - } as QueryConnectionChannelsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConnectionChannelsRequest { - const message = { - ...baseQueryConnectionChannelsRequest, - } as QueryConnectionChannelsRequest; - if (object.connection !== undefined && object.connection !== null) { - message.connection = String(object.connection); - } else { - message.connection = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryConnectionChannelsRequest): unknown { - const obj: any = {}; - message.connection !== undefined && (obj.connection = message.connection); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionChannelsRequest { - const message = { - ...baseQueryConnectionChannelsRequest, - } as QueryConnectionChannelsRequest; - if (object.connection !== undefined && object.connection !== null) { - message.connection = object.connection; - } else { - message.connection = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryConnectionChannelsResponse: object = {}; - -export const QueryConnectionChannelsResponse = { - encode( - message: QueryConnectionChannelsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.channels) { - IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConnectionChannelsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConnectionChannelsResponse, - } as QueryConnectionChannelsResponse; - message.channels = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channels.push( - IdentifiedChannel.decode(reader, reader.uint32()) - ); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConnectionChannelsResponse { - const message = { - ...baseQueryConnectionChannelsResponse, - } as QueryConnectionChannelsResponse; - message.channels = []; - if (object.channels !== undefined && object.channels !== null) { - for (const e of object.channels) { - message.channels.push(IdentifiedChannel.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - return message; - }, - - toJSON(message: QueryConnectionChannelsResponse): unknown { - const obj: any = {}; - if (message.channels) { - obj.channels = message.channels.map((e) => - e ? IdentifiedChannel.toJSON(e) : undefined - ); - } else { - obj.channels = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionChannelsResponse { - const message = { - ...baseQueryConnectionChannelsResponse, - } as QueryConnectionChannelsResponse; - message.channels = []; - if (object.channels !== undefined && object.channels !== null) { - for (const e of object.channels) { - message.channels.push(IdentifiedChannel.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - return message; - }, -}; - -const baseQueryChannelClientStateRequest: object = { - port_id: "", - channel_id: "", -}; - -export const QueryChannelClientStateRequest = { - encode( - message: QueryChannelClientStateRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryChannelClientStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryChannelClientStateRequest, - } as QueryChannelClientStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryChannelClientStateRequest { - const message = { - ...baseQueryChannelClientStateRequest, - } as QueryChannelClientStateRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - return message; - }, - - toJSON(message: QueryChannelClientStateRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryChannelClientStateRequest { - const message = { - ...baseQueryChannelClientStateRequest, - } as QueryChannelClientStateRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - return message; - }, -}; - -const baseQueryChannelClientStateResponse: object = {}; - -export const QueryChannelClientStateResponse = { - encode( - message: QueryChannelClientStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.identified_client_state !== undefined) { - IdentifiedClientState.encode( - message.identified_client_state, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryChannelClientStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryChannelClientStateResponse, - } as QueryChannelClientStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identified_client_state = IdentifiedClientState.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryChannelClientStateResponse { - const message = { - ...baseQueryChannelClientStateResponse, - } as QueryChannelClientStateResponse; - if ( - object.identified_client_state !== undefined && - object.identified_client_state !== null - ) { - message.identified_client_state = IdentifiedClientState.fromJSON( - object.identified_client_state - ); - } else { - message.identified_client_state = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryChannelClientStateResponse): unknown { - const obj: any = {}; - message.identified_client_state !== undefined && - (obj.identified_client_state = message.identified_client_state - ? IdentifiedClientState.toJSON(message.identified_client_state) - : undefined); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryChannelClientStateResponse { - const message = { - ...baseQueryChannelClientStateResponse, - } as QueryChannelClientStateResponse; - if ( - object.identified_client_state !== undefined && - object.identified_client_state !== null - ) { - message.identified_client_state = IdentifiedClientState.fromPartial( - object.identified_client_state - ); - } else { - message.identified_client_state = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryChannelConsensusStateRequest: object = { - port_id: "", - channel_id: "", - revision_number: 0, - revision_height: 0, -}; - -export const QueryChannelConsensusStateRequest = { - encode( - message: QueryChannelConsensusStateRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.revision_number !== 0) { - writer.uint32(24).uint64(message.revision_number); - } - if (message.revision_height !== 0) { - writer.uint32(32).uint64(message.revision_height); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryChannelConsensusStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryChannelConsensusStateRequest, - } as QueryChannelConsensusStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.revision_number = longToNumber(reader.uint64() as Long); - break; - case 4: - message.revision_height = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryChannelConsensusStateRequest { - const message = { - ...baseQueryChannelConsensusStateRequest, - } as QueryChannelConsensusStateRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = Number(object.revision_number); - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = Number(object.revision_height); - } else { - message.revision_height = 0; - } - return message; - }, - - toJSON(message: QueryChannelConsensusStateRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.revision_number !== undefined && - (obj.revision_number = message.revision_number); - message.revision_height !== undefined && - (obj.revision_height = message.revision_height); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryChannelConsensusStateRequest { - const message = { - ...baseQueryChannelConsensusStateRequest, - } as QueryChannelConsensusStateRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = object.revision_number; - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = object.revision_height; - } else { - message.revision_height = 0; - } - return message; - }, -}; - -const baseQueryChannelConsensusStateResponse: object = { client_id: "" }; - -export const QueryChannelConsensusStateResponse = { - encode( - message: QueryChannelConsensusStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(10).fork()).ldelim(); - } - if (message.client_id !== "") { - writer.uint32(18).string(message.client_id); - } - if (message.proof.length !== 0) { - writer.uint32(26).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryChannelConsensusStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryChannelConsensusStateResponse, - } as QueryChannelConsensusStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - case 2: - message.client_id = reader.string(); - break; - case 3: - message.proof = reader.bytes(); - break; - case 4: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryChannelConsensusStateResponse { - const message = { - ...baseQueryChannelConsensusStateResponse, - } as QueryChannelConsensusStateResponse; - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryChannelConsensusStateResponse): unknown { - const obj: any = {}; - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - message.client_id !== undefined && (obj.client_id = message.client_id); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryChannelConsensusStateResponse { - const message = { - ...baseQueryChannelConsensusStateResponse, - } as QueryChannelConsensusStateResponse; - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryPacketCommitmentRequest: object = { - port_id: "", - channel_id: "", - sequence: 0, -}; - -export const QueryPacketCommitmentRequest = { - encode( - message: QueryPacketCommitmentRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.sequence !== 0) { - writer.uint32(24).uint64(message.sequence); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketCommitmentRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketCommitmentRequest, - } as QueryPacketCommitmentRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketCommitmentRequest { - const message = { - ...baseQueryPacketCommitmentRequest, - } as QueryPacketCommitmentRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; - }, - - toJSON(message: QueryPacketCommitmentRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.sequence !== undefined && (obj.sequence = message.sequence); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketCommitmentRequest { - const message = { - ...baseQueryPacketCommitmentRequest, - } as QueryPacketCommitmentRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - return message; - }, -}; - -const baseQueryPacketCommitmentResponse: object = {}; - -export const QueryPacketCommitmentResponse = { - encode( - message: QueryPacketCommitmentResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.commitment.length !== 0) { - writer.uint32(10).bytes(message.commitment); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketCommitmentResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketCommitmentResponse, - } as QueryPacketCommitmentResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.commitment = reader.bytes(); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketCommitmentResponse { - const message = { - ...baseQueryPacketCommitmentResponse, - } as QueryPacketCommitmentResponse; - if (object.commitment !== undefined && object.commitment !== null) { - message.commitment = bytesFromBase64(object.commitment); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryPacketCommitmentResponse): unknown { - const obj: any = {}; - message.commitment !== undefined && - (obj.commitment = base64FromBytes( - message.commitment !== undefined ? message.commitment : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketCommitmentResponse { - const message = { - ...baseQueryPacketCommitmentResponse, - } as QueryPacketCommitmentResponse; - if (object.commitment !== undefined && object.commitment !== null) { - message.commitment = object.commitment; - } else { - message.commitment = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryPacketCommitmentsRequest: object = { - port_id: "", - channel_id: "", -}; - -export const QueryPacketCommitmentsRequest = { - encode( - message: QueryPacketCommitmentsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketCommitmentsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketCommitmentsRequest, - } as QueryPacketCommitmentsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketCommitmentsRequest { - const message = { - ...baseQueryPacketCommitmentsRequest, - } as QueryPacketCommitmentsRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryPacketCommitmentsRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketCommitmentsRequest { - const message = { - ...baseQueryPacketCommitmentsRequest, - } as QueryPacketCommitmentsRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryPacketCommitmentsResponse: object = {}; - -export const QueryPacketCommitmentsResponse = { - encode( - message: QueryPacketCommitmentsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.commitments) { - PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketCommitmentsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketCommitmentsResponse, - } as QueryPacketCommitmentsResponse; - message.commitments = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.commitments.push(PacketState.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketCommitmentsResponse { - const message = { - ...baseQueryPacketCommitmentsResponse, - } as QueryPacketCommitmentsResponse; - message.commitments = []; - if (object.commitments !== undefined && object.commitments !== null) { - for (const e of object.commitments) { - message.commitments.push(PacketState.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - return message; - }, - - toJSON(message: QueryPacketCommitmentsResponse): unknown { - const obj: any = {}; - if (message.commitments) { - obj.commitments = message.commitments.map((e) => - e ? PacketState.toJSON(e) : undefined - ); - } else { - obj.commitments = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketCommitmentsResponse { - const message = { - ...baseQueryPacketCommitmentsResponse, - } as QueryPacketCommitmentsResponse; - message.commitments = []; - if (object.commitments !== undefined && object.commitments !== null) { - for (const e of object.commitments) { - message.commitments.push(PacketState.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - return message; - }, -}; - -const baseQueryPacketReceiptRequest: object = { - port_id: "", - channel_id: "", - sequence: 0, -}; - -export const QueryPacketReceiptRequest = { - encode( - message: QueryPacketReceiptRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.sequence !== 0) { - writer.uint32(24).uint64(message.sequence); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketReceiptRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketReceiptRequest, - } as QueryPacketReceiptRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketReceiptRequest { - const message = { - ...baseQueryPacketReceiptRequest, - } as QueryPacketReceiptRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; - }, - - toJSON(message: QueryPacketReceiptRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.sequence !== undefined && (obj.sequence = message.sequence); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketReceiptRequest { - const message = { - ...baseQueryPacketReceiptRequest, - } as QueryPacketReceiptRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - return message; - }, -}; - -const baseQueryPacketReceiptResponse: object = { received: false }; - -export const QueryPacketReceiptResponse = { - encode( - message: QueryPacketReceiptResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.received === true) { - writer.uint32(16).bool(message.received); - } - if (message.proof.length !== 0) { - writer.uint32(26).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketReceiptResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketReceiptResponse, - } as QueryPacketReceiptResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.received = reader.bool(); - break; - case 3: - message.proof = reader.bytes(); - break; - case 4: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketReceiptResponse { - const message = { - ...baseQueryPacketReceiptResponse, - } as QueryPacketReceiptResponse; - if (object.received !== undefined && object.received !== null) { - message.received = Boolean(object.received); - } else { - message.received = false; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryPacketReceiptResponse): unknown { - const obj: any = {}; - message.received !== undefined && (obj.received = message.received); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketReceiptResponse { - const message = { - ...baseQueryPacketReceiptResponse, - } as QueryPacketReceiptResponse; - if (object.received !== undefined && object.received !== null) { - message.received = object.received; - } else { - message.received = false; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryPacketAcknowledgementRequest: object = { - port_id: "", - channel_id: "", - sequence: 0, -}; - -export const QueryPacketAcknowledgementRequest = { - encode( - message: QueryPacketAcknowledgementRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.sequence !== 0) { - writer.uint32(24).uint64(message.sequence); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketAcknowledgementRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketAcknowledgementRequest, - } as QueryPacketAcknowledgementRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketAcknowledgementRequest { - const message = { - ...baseQueryPacketAcknowledgementRequest, - } as QueryPacketAcknowledgementRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; - }, - - toJSON(message: QueryPacketAcknowledgementRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.sequence !== undefined && (obj.sequence = message.sequence); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketAcknowledgementRequest { - const message = { - ...baseQueryPacketAcknowledgementRequest, - } as QueryPacketAcknowledgementRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - return message; - }, -}; - -const baseQueryPacketAcknowledgementResponse: object = {}; - -export const QueryPacketAcknowledgementResponse = { - encode( - message: QueryPacketAcknowledgementResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.acknowledgement.length !== 0) { - writer.uint32(10).bytes(message.acknowledgement); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketAcknowledgementResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketAcknowledgementResponse, - } as QueryPacketAcknowledgementResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.acknowledgement = reader.bytes(); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketAcknowledgementResponse { - const message = { - ...baseQueryPacketAcknowledgementResponse, - } as QueryPacketAcknowledgementResponse; - if ( - object.acknowledgement !== undefined && - object.acknowledgement !== null - ) { - message.acknowledgement = bytesFromBase64(object.acknowledgement); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryPacketAcknowledgementResponse): unknown { - const obj: any = {}; - message.acknowledgement !== undefined && - (obj.acknowledgement = base64FromBytes( - message.acknowledgement !== undefined - ? message.acknowledgement - : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketAcknowledgementResponse { - const message = { - ...baseQueryPacketAcknowledgementResponse, - } as QueryPacketAcknowledgementResponse; - if ( - object.acknowledgement !== undefined && - object.acknowledgement !== null - ) { - message.acknowledgement = object.acknowledgement; - } else { - message.acknowledgement = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryPacketAcknowledgementsRequest: object = { - port_id: "", - channel_id: "", - packet_commitment_sequences: 0, -}; - -export const QueryPacketAcknowledgementsRequest = { - encode( - message: QueryPacketAcknowledgementsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); - } - writer.uint32(34).fork(); - for (const v of message.packet_commitment_sequences) { - writer.uint64(v); - } - writer.ldelim(); - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketAcknowledgementsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketAcknowledgementsRequest, - } as QueryPacketAcknowledgementsRequest; - message.packet_commitment_sequences = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - case 4: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.packet_commitment_sequences.push( - longToNumber(reader.uint64() as Long) - ); - } - } else { - message.packet_commitment_sequences.push( - longToNumber(reader.uint64() as Long) - ); - } - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketAcknowledgementsRequest { - const message = { - ...baseQueryPacketAcknowledgementsRequest, - } as QueryPacketAcknowledgementsRequest; - message.packet_commitment_sequences = []; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - if ( - object.packet_commitment_sequences !== undefined && - object.packet_commitment_sequences !== null - ) { - for (const e of object.packet_commitment_sequences) { - message.packet_commitment_sequences.push(Number(e)); - } - } - return message; - }, - - toJSON(message: QueryPacketAcknowledgementsRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - if (message.packet_commitment_sequences) { - obj.packet_commitment_sequences = message.packet_commitment_sequences.map( - (e) => e - ); - } else { - obj.packet_commitment_sequences = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketAcknowledgementsRequest { - const message = { - ...baseQueryPacketAcknowledgementsRequest, - } as QueryPacketAcknowledgementsRequest; - message.packet_commitment_sequences = []; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - if ( - object.packet_commitment_sequences !== undefined && - object.packet_commitment_sequences !== null - ) { - for (const e of object.packet_commitment_sequences) { - message.packet_commitment_sequences.push(e); - } - } - return message; - }, -}; - -const baseQueryPacketAcknowledgementsResponse: object = {}; - -export const QueryPacketAcknowledgementsResponse = { - encode( - message: QueryPacketAcknowledgementsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.acknowledgements) { - PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPacketAcknowledgementsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPacketAcknowledgementsResponse, - } as QueryPacketAcknowledgementsResponse; - message.acknowledgements = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.acknowledgements.push( - PacketState.decode(reader, reader.uint32()) - ); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryPacketAcknowledgementsResponse { - const message = { - ...baseQueryPacketAcknowledgementsResponse, - } as QueryPacketAcknowledgementsResponse; - message.acknowledgements = []; - if ( - object.acknowledgements !== undefined && - object.acknowledgements !== null - ) { - for (const e of object.acknowledgements) { - message.acknowledgements.push(PacketState.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - return message; - }, - - toJSON(message: QueryPacketAcknowledgementsResponse): unknown { - const obj: any = {}; - if (message.acknowledgements) { - obj.acknowledgements = message.acknowledgements.map((e) => - e ? PacketState.toJSON(e) : undefined - ); - } else { - obj.acknowledgements = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryPacketAcknowledgementsResponse { - const message = { - ...baseQueryPacketAcknowledgementsResponse, - } as QueryPacketAcknowledgementsResponse; - message.acknowledgements = []; - if ( - object.acknowledgements !== undefined && - object.acknowledgements !== null - ) { - for (const e of object.acknowledgements) { - message.acknowledgements.push(PacketState.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - return message; - }, -}; - -const baseQueryUnreceivedPacketsRequest: object = { - port_id: "", - channel_id: "", - packet_commitment_sequences: 0, -}; - -export const QueryUnreceivedPacketsRequest = { - encode( - message: QueryUnreceivedPacketsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - writer.uint32(26).fork(); - for (const v of message.packet_commitment_sequences) { - writer.uint64(v); - } - writer.ldelim(); - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUnreceivedPacketsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUnreceivedPacketsRequest, - } as QueryUnreceivedPacketsRequest; - message.packet_commitment_sequences = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.packet_commitment_sequences.push( - longToNumber(reader.uint64() as Long) - ); - } - } else { - message.packet_commitment_sequences.push( - longToNumber(reader.uint64() as Long) - ); - } - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUnreceivedPacketsRequest { - const message = { - ...baseQueryUnreceivedPacketsRequest, - } as QueryUnreceivedPacketsRequest; - message.packet_commitment_sequences = []; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if ( - object.packet_commitment_sequences !== undefined && - object.packet_commitment_sequences !== null - ) { - for (const e of object.packet_commitment_sequences) { - message.packet_commitment_sequences.push(Number(e)); - } - } - return message; - }, - - toJSON(message: QueryUnreceivedPacketsRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - if (message.packet_commitment_sequences) { - obj.packet_commitment_sequences = message.packet_commitment_sequences.map( - (e) => e - ); - } else { - obj.packet_commitment_sequences = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUnreceivedPacketsRequest { - const message = { - ...baseQueryUnreceivedPacketsRequest, - } as QueryUnreceivedPacketsRequest; - message.packet_commitment_sequences = []; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if ( - object.packet_commitment_sequences !== undefined && - object.packet_commitment_sequences !== null - ) { - for (const e of object.packet_commitment_sequences) { - message.packet_commitment_sequences.push(e); - } - } - return message; - }, -}; - -const baseQueryUnreceivedPacketsResponse: object = { sequences: 0 }; - -export const QueryUnreceivedPacketsResponse = { - encode( - message: QueryUnreceivedPacketsResponse, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.sequences) { - writer.uint64(v); - } - writer.ldelim(); - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUnreceivedPacketsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUnreceivedPacketsResponse, - } as QueryUnreceivedPacketsResponse; - message.sequences = []; - 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.sequences.push(longToNumber(reader.uint64() as Long)); - } - } else { - message.sequences.push(longToNumber(reader.uint64() as Long)); - } - break; - case 2: - message.height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUnreceivedPacketsResponse { - const message = { - ...baseQueryUnreceivedPacketsResponse, - } as QueryUnreceivedPacketsResponse; - message.sequences = []; - if (object.sequences !== undefined && object.sequences !== null) { - for (const e of object.sequences) { - message.sequences.push(Number(e)); - } - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - return message; - }, - - toJSON(message: QueryUnreceivedPacketsResponse): unknown { - const obj: any = {}; - if (message.sequences) { - obj.sequences = message.sequences.map((e) => e); - } else { - obj.sequences = []; - } - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUnreceivedPacketsResponse { - const message = { - ...baseQueryUnreceivedPacketsResponse, - } as QueryUnreceivedPacketsResponse; - message.sequences = []; - if (object.sequences !== undefined && object.sequences !== null) { - for (const e of object.sequences) { - message.sequences.push(e); - } - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - return message; - }, -}; - -const baseQueryUnreceivedAcksRequest: object = { - port_id: "", - channel_id: "", - packet_ack_sequences: 0, -}; - -export const QueryUnreceivedAcksRequest = { - encode( - message: QueryUnreceivedAcksRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - writer.uint32(26).fork(); - for (const v of message.packet_ack_sequences) { - writer.uint64(v); - } - writer.ldelim(); - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUnreceivedAcksRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUnreceivedAcksRequest, - } as QueryUnreceivedAcksRequest; - message.packet_ack_sequences = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.packet_ack_sequences.push( - longToNumber(reader.uint64() as Long) - ); - } - } else { - message.packet_ack_sequences.push( - longToNumber(reader.uint64() as Long) - ); - } - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUnreceivedAcksRequest { - const message = { - ...baseQueryUnreceivedAcksRequest, - } as QueryUnreceivedAcksRequest; - message.packet_ack_sequences = []; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if ( - object.packet_ack_sequences !== undefined && - object.packet_ack_sequences !== null - ) { - for (const e of object.packet_ack_sequences) { - message.packet_ack_sequences.push(Number(e)); - } - } - return message; - }, - - toJSON(message: QueryUnreceivedAcksRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - if (message.packet_ack_sequences) { - obj.packet_ack_sequences = message.packet_ack_sequences.map((e) => e); - } else { - obj.packet_ack_sequences = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUnreceivedAcksRequest { - const message = { - ...baseQueryUnreceivedAcksRequest, - } as QueryUnreceivedAcksRequest; - message.packet_ack_sequences = []; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if ( - object.packet_ack_sequences !== undefined && - object.packet_ack_sequences !== null - ) { - for (const e of object.packet_ack_sequences) { - message.packet_ack_sequences.push(e); - } - } - return message; - }, -}; - -const baseQueryUnreceivedAcksResponse: object = { sequences: 0 }; - -export const QueryUnreceivedAcksResponse = { - encode( - message: QueryUnreceivedAcksResponse, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.sequences) { - writer.uint64(v); - } - writer.ldelim(); - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUnreceivedAcksResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUnreceivedAcksResponse, - } as QueryUnreceivedAcksResponse; - message.sequences = []; - 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.sequences.push(longToNumber(reader.uint64() as Long)); - } - } else { - message.sequences.push(longToNumber(reader.uint64() as Long)); - } - break; - case 2: - message.height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUnreceivedAcksResponse { - const message = { - ...baseQueryUnreceivedAcksResponse, - } as QueryUnreceivedAcksResponse; - message.sequences = []; - if (object.sequences !== undefined && object.sequences !== null) { - for (const e of object.sequences) { - message.sequences.push(Number(e)); - } - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - return message; - }, - - toJSON(message: QueryUnreceivedAcksResponse): unknown { - const obj: any = {}; - if (message.sequences) { - obj.sequences = message.sequences.map((e) => e); - } else { - obj.sequences = []; - } - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUnreceivedAcksResponse { - const message = { - ...baseQueryUnreceivedAcksResponse, - } as QueryUnreceivedAcksResponse; - message.sequences = []; - if (object.sequences !== undefined && object.sequences !== null) { - for (const e of object.sequences) { - message.sequences.push(e); - } - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - return message; - }, -}; - -const baseQueryNextSequenceReceiveRequest: object = { - port_id: "", - channel_id: "", -}; - -export const QueryNextSequenceReceiveRequest = { - encode( - message: QueryNextSequenceReceiveRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryNextSequenceReceiveRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryNextSequenceReceiveRequest, - } as QueryNextSequenceReceiveRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryNextSequenceReceiveRequest { - const message = { - ...baseQueryNextSequenceReceiveRequest, - } as QueryNextSequenceReceiveRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - return message; - }, - - toJSON(message: QueryNextSequenceReceiveRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryNextSequenceReceiveRequest { - const message = { - ...baseQueryNextSequenceReceiveRequest, - } as QueryNextSequenceReceiveRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - return message; - }, -}; - -const baseQueryNextSequenceReceiveResponse: object = { - next_sequence_receive: 0, -}; - -export const QueryNextSequenceReceiveResponse = { - encode( - message: QueryNextSequenceReceiveResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.next_sequence_receive !== 0) { - writer.uint32(8).uint64(message.next_sequence_receive); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryNextSequenceReceiveResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryNextSequenceReceiveResponse, - } as QueryNextSequenceReceiveResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_sequence_receive = longToNumber(reader.uint64() as Long); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryNextSequenceReceiveResponse { - const message = { - ...baseQueryNextSequenceReceiveResponse, - } as QueryNextSequenceReceiveResponse; - if ( - object.next_sequence_receive !== undefined && - object.next_sequence_receive !== null - ) { - message.next_sequence_receive = Number(object.next_sequence_receive); - } else { - message.next_sequence_receive = 0; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryNextSequenceReceiveResponse): unknown { - const obj: any = {}; - message.next_sequence_receive !== undefined && - (obj.next_sequence_receive = message.next_sequence_receive); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryNextSequenceReceiveResponse { - const message = { - ...baseQueryNextSequenceReceiveResponse, - } as QueryNextSequenceReceiveResponse; - if ( - object.next_sequence_receive !== undefined && - object.next_sequence_receive !== null - ) { - message.next_sequence_receive = object.next_sequence_receive; - } else { - message.next_sequence_receive = 0; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -/** Query provides defines the gRPC querier service */ -export interface Query { - /** Channel queries an IBC Channel. */ - Channel(request: QueryChannelRequest): Promise; - /** Channels queries all the IBC channels of a chain. */ - Channels(request: QueryChannelsRequest): Promise; - /** - * ConnectionChannels queries all the channels associated with a connection - * end. - */ - ConnectionChannels( - request: QueryConnectionChannelsRequest - ): Promise; - /** - * ChannelClientState queries for the client state for the channel associated - * with the provided channel identifiers. - */ - ChannelClientState( - request: QueryChannelClientStateRequest - ): Promise; - /** - * ChannelConsensusState queries for the consensus state for the channel - * associated with the provided channel identifiers. - */ - ChannelConsensusState( - request: QueryChannelConsensusStateRequest - ): Promise; - /** PacketCommitment queries a stored packet commitment hash. */ - PacketCommitment( - request: QueryPacketCommitmentRequest - ): Promise; - /** - * PacketCommitments returns all the packet commitments hashes associated - * with a channel. - */ - PacketCommitments( - request: QueryPacketCommitmentsRequest - ): Promise; - /** - * PacketReceipt queries if a given packet sequence has been received on the - * queried chain - */ - PacketReceipt( - request: QueryPacketReceiptRequest - ): Promise; - /** PacketAcknowledgement queries a stored packet acknowledgement hash. */ - PacketAcknowledgement( - request: QueryPacketAcknowledgementRequest - ): Promise; - /** - * PacketAcknowledgements returns all the packet acknowledgements associated - * with a channel. - */ - PacketAcknowledgements( - request: QueryPacketAcknowledgementsRequest - ): Promise; - /** - * UnreceivedPackets returns all the unreceived IBC packets associated with a - * channel and sequences. - */ - UnreceivedPackets( - request: QueryUnreceivedPacketsRequest - ): Promise; - /** - * UnreceivedAcks returns all the unreceived IBC acknowledgements associated - * with a channel and sequences. - */ - UnreceivedAcks( - request: QueryUnreceivedAcksRequest - ): Promise; - /** NextSequenceReceive returns the next receive sequence for a given channel. */ - NextSequenceReceive( - request: QueryNextSequenceReceiveRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Channel(request: QueryChannelRequest): Promise { - const data = QueryChannelRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "Channel", - data - ); - return promise.then((data) => - QueryChannelResponse.decode(new Reader(data)) - ); - } - - Channels(request: QueryChannelsRequest): Promise { - const data = QueryChannelsRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "Channels", - data - ); - return promise.then((data) => - QueryChannelsResponse.decode(new Reader(data)) - ); - } - - ConnectionChannels( - request: QueryConnectionChannelsRequest - ): Promise { - const data = QueryConnectionChannelsRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "ConnectionChannels", - data - ); - return promise.then((data) => - QueryConnectionChannelsResponse.decode(new Reader(data)) - ); - } - - ChannelClientState( - request: QueryChannelClientStateRequest - ): Promise { - const data = QueryChannelClientStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "ChannelClientState", - data - ); - return promise.then((data) => - QueryChannelClientStateResponse.decode(new Reader(data)) - ); - } - - ChannelConsensusState( - request: QueryChannelConsensusStateRequest - ): Promise { - const data = QueryChannelConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "ChannelConsensusState", - data - ); - return promise.then((data) => - QueryChannelConsensusStateResponse.decode(new Reader(data)) - ); - } - - PacketCommitment( - request: QueryPacketCommitmentRequest - ): Promise { - const data = QueryPacketCommitmentRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "PacketCommitment", - data - ); - return promise.then((data) => - QueryPacketCommitmentResponse.decode(new Reader(data)) - ); - } - - PacketCommitments( - request: QueryPacketCommitmentsRequest - ): Promise { - const data = QueryPacketCommitmentsRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "PacketCommitments", - data - ); - return promise.then((data) => - QueryPacketCommitmentsResponse.decode(new Reader(data)) - ); - } - - PacketReceipt( - request: QueryPacketReceiptRequest - ): Promise { - const data = QueryPacketReceiptRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "PacketReceipt", - data - ); - return promise.then((data) => - QueryPacketReceiptResponse.decode(new Reader(data)) - ); - } - - PacketAcknowledgement( - request: QueryPacketAcknowledgementRequest - ): Promise { - const data = QueryPacketAcknowledgementRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "PacketAcknowledgement", - data - ); - return promise.then((data) => - QueryPacketAcknowledgementResponse.decode(new Reader(data)) - ); - } - - PacketAcknowledgements( - request: QueryPacketAcknowledgementsRequest - ): Promise { - const data = QueryPacketAcknowledgementsRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "PacketAcknowledgements", - data - ); - return promise.then((data) => - QueryPacketAcknowledgementsResponse.decode(new Reader(data)) - ); - } - - UnreceivedPackets( - request: QueryUnreceivedPacketsRequest - ): Promise { - const data = QueryUnreceivedPacketsRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "UnreceivedPackets", - data - ); - return promise.then((data) => - QueryUnreceivedPacketsResponse.decode(new Reader(data)) - ); - } - - UnreceivedAcks( - request: QueryUnreceivedAcksRequest - ): Promise { - const data = QueryUnreceivedAcksRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "UnreceivedAcks", - data - ); - return promise.then((data) => - QueryUnreceivedAcksResponse.decode(new Reader(data)) - ); - } - - NextSequenceReceive( - request: QueryNextSequenceReceiveRequest - ): Promise { - const data = QueryNextSequenceReceiveRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Query", - "NextSequenceReceive", - data - ); - return promise.then((data) => - QueryNextSequenceReceiveResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/tx.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/tx.ts deleted file mode 100644 index d5bb09bf..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/channel/v1/tx.ts +++ /dev/null @@ -1,2288 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { Channel, Packet } from "../../../../ibc/core/channel/v1/channel"; -import { Height } from "../../../../ibc/core/client/v1/client"; - -export const protobufPackage = "ibc.core.channel.v1"; - -/** - * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It - * is called by a relayer on Chain A. - */ -export interface MsgChannelOpenInit { - port_id: string; - channel: Channel | undefined; - signer: string; -} - -/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ -export interface MsgChannelOpenInitResponse {} - -/** - * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel - * on Chain B. - */ -export interface MsgChannelOpenTry { - port_id: string; - /** - * in the case of crossing hello's, when both chains call OpenInit, we need - * the channel identifier of the previous channel in state INIT - */ - previous_channel_id: string; - channel: Channel | undefined; - counterparty_version: string; - proof_init: Uint8Array; - proof_height: Height | undefined; - signer: string; -} - -/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ -export interface MsgChannelOpenTryResponse {} - -/** - * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge - * the change of channel state to TRYOPEN on Chain B. - */ -export interface MsgChannelOpenAck { - port_id: string; - channel_id: string; - counterparty_channel_id: string; - counterparty_version: string; - proof_try: Uint8Array; - proof_height: Height | undefined; - signer: string; -} - -/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ -export interface MsgChannelOpenAckResponse {} - -/** - * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to - * acknowledge the change of channel state to OPEN on Chain A. - */ -export interface MsgChannelOpenConfirm { - port_id: string; - channel_id: string; - proof_ack: Uint8Array; - proof_height: Height | undefined; - signer: string; -} - -/** - * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response - * type. - */ -export interface MsgChannelOpenConfirmResponse {} - -/** - * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A - * to close a channel with Chain B. - */ -export interface MsgChannelCloseInit { - port_id: string; - channel_id: string; - signer: string; -} - -/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ -export interface MsgChannelCloseInitResponse {} - -/** - * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B - * to acknowledge the change of channel state to CLOSED on Chain A. - */ -export interface MsgChannelCloseConfirm { - port_id: string; - channel_id: string; - proof_init: Uint8Array; - proof_height: Height | undefined; - signer: string; -} - -/** - * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response - * type. - */ -export interface MsgChannelCloseConfirmResponse {} - -/** MsgRecvPacket receives incoming IBC packet */ -export interface MsgRecvPacket { - packet: Packet | undefined; - proof_commitment: Uint8Array; - proof_height: Height | undefined; - signer: string; -} - -/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ -export interface MsgRecvPacketResponse {} - -/** MsgTimeout receives timed-out packet */ -export interface MsgTimeout { - packet: Packet | undefined; - proof_unreceived: Uint8Array; - proof_height: Height | undefined; - next_sequence_recv: number; - signer: string; -} - -/** MsgTimeoutResponse defines the Msg/Timeout response type. */ -export interface MsgTimeoutResponse {} - -/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ -export interface MsgTimeoutOnClose { - packet: Packet | undefined; - proof_unreceived: Uint8Array; - proof_close: Uint8Array; - proof_height: Height | undefined; - next_sequence_recv: number; - signer: string; -} - -/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ -export interface MsgTimeoutOnCloseResponse {} - -/** MsgAcknowledgement receives incoming IBC acknowledgement */ -export interface MsgAcknowledgement { - packet: Packet | undefined; - acknowledgement: Uint8Array; - proof_acked: Uint8Array; - proof_height: Height | undefined; - signer: string; -} - -/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ -export interface MsgAcknowledgementResponse {} - -const baseMsgChannelOpenInit: object = { port_id: "", signer: "" }; - -export const MsgChannelOpenInit = { - encode( - message: MsgChannelOpenInit, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel !== undefined) { - Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(26).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgChannelOpenInit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgChannelOpenInit } as MsgChannelOpenInit; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel = Channel.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgChannelOpenInit { - const message = { ...baseMsgChannelOpenInit } as MsgChannelOpenInit; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel !== undefined && object.channel !== null) { - message.channel = Channel.fromJSON(object.channel); - } else { - message.channel = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgChannelOpenInit): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel !== undefined && - (obj.channel = message.channel - ? Channel.toJSON(message.channel) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgChannelOpenInit { - const message = { ...baseMsgChannelOpenInit } as MsgChannelOpenInit; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel !== undefined && object.channel !== null) { - message.channel = Channel.fromPartial(object.channel); - } else { - message.channel = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgChannelOpenInitResponse: object = {}; - -export const MsgChannelOpenInitResponse = { - encode( - _: MsgChannelOpenInitResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgChannelOpenInitResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgChannelOpenInitResponse, - } as MsgChannelOpenInitResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgChannelOpenInitResponse { - const message = { - ...baseMsgChannelOpenInitResponse, - } as MsgChannelOpenInitResponse; - return message; - }, - - toJSON(_: MsgChannelOpenInitResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgChannelOpenInitResponse { - const message = { - ...baseMsgChannelOpenInitResponse, - } as MsgChannelOpenInitResponse; - return message; - }, -}; - -const baseMsgChannelOpenTry: object = { - port_id: "", - previous_channel_id: "", - counterparty_version: "", - signer: "", -}; - -export const MsgChannelOpenTry = { - encode(message: MsgChannelOpenTry, writer: Writer = Writer.create()): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.previous_channel_id !== "") { - writer.uint32(18).string(message.previous_channel_id); - } - if (message.channel !== undefined) { - Channel.encode(message.channel, writer.uint32(26).fork()).ldelim(); - } - if (message.counterparty_version !== "") { - writer.uint32(34).string(message.counterparty_version); - } - if (message.proof_init.length !== 0) { - writer.uint32(42).bytes(message.proof_init); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(50).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(58).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgChannelOpenTry { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgChannelOpenTry } as MsgChannelOpenTry; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.previous_channel_id = reader.string(); - break; - case 3: - message.channel = Channel.decode(reader, reader.uint32()); - break; - case 4: - message.counterparty_version = reader.string(); - break; - case 5: - message.proof_init = reader.bytes(); - break; - case 6: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 7: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgChannelOpenTry { - const message = { ...baseMsgChannelOpenTry } as MsgChannelOpenTry; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if ( - object.previous_channel_id !== undefined && - object.previous_channel_id !== null - ) { - message.previous_channel_id = String(object.previous_channel_id); - } else { - message.previous_channel_id = ""; - } - if (object.channel !== undefined && object.channel !== null) { - message.channel = Channel.fromJSON(object.channel); - } else { - message.channel = undefined; - } - if ( - object.counterparty_version !== undefined && - object.counterparty_version !== null - ) { - message.counterparty_version = String(object.counterparty_version); - } else { - message.counterparty_version = ""; - } - if (object.proof_init !== undefined && object.proof_init !== null) { - message.proof_init = bytesFromBase64(object.proof_init); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgChannelOpenTry): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.previous_channel_id !== undefined && - (obj.previous_channel_id = message.previous_channel_id); - message.channel !== undefined && - (obj.channel = message.channel - ? Channel.toJSON(message.channel) - : undefined); - message.counterparty_version !== undefined && - (obj.counterparty_version = message.counterparty_version); - message.proof_init !== undefined && - (obj.proof_init = base64FromBytes( - message.proof_init !== undefined ? message.proof_init : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgChannelOpenTry { - const message = { ...baseMsgChannelOpenTry } as MsgChannelOpenTry; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if ( - object.previous_channel_id !== undefined && - object.previous_channel_id !== null - ) { - message.previous_channel_id = object.previous_channel_id; - } else { - message.previous_channel_id = ""; - } - if (object.channel !== undefined && object.channel !== null) { - message.channel = Channel.fromPartial(object.channel); - } else { - message.channel = undefined; - } - if ( - object.counterparty_version !== undefined && - object.counterparty_version !== null - ) { - message.counterparty_version = object.counterparty_version; - } else { - message.counterparty_version = ""; - } - if (object.proof_init !== undefined && object.proof_init !== null) { - message.proof_init = object.proof_init; - } else { - message.proof_init = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgChannelOpenTryResponse: object = {}; - -export const MsgChannelOpenTryResponse = { - encode( - _: MsgChannelOpenTryResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgChannelOpenTryResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgChannelOpenTryResponse, - } as MsgChannelOpenTryResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgChannelOpenTryResponse { - const message = { - ...baseMsgChannelOpenTryResponse, - } as MsgChannelOpenTryResponse; - return message; - }, - - toJSON(_: MsgChannelOpenTryResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgChannelOpenTryResponse { - const message = { - ...baseMsgChannelOpenTryResponse, - } as MsgChannelOpenTryResponse; - return message; - }, -}; - -const baseMsgChannelOpenAck: object = { - port_id: "", - channel_id: "", - counterparty_channel_id: "", - counterparty_version: "", - signer: "", -}; - -export const MsgChannelOpenAck = { - encode(message: MsgChannelOpenAck, writer: Writer = Writer.create()): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.counterparty_channel_id !== "") { - writer.uint32(26).string(message.counterparty_channel_id); - } - if (message.counterparty_version !== "") { - writer.uint32(34).string(message.counterparty_version); - } - if (message.proof_try.length !== 0) { - writer.uint32(42).bytes(message.proof_try); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(50).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(58).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgChannelOpenAck { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgChannelOpenAck } as MsgChannelOpenAck; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.counterparty_channel_id = reader.string(); - break; - case 4: - message.counterparty_version = reader.string(); - break; - case 5: - message.proof_try = reader.bytes(); - break; - case 6: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 7: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgChannelOpenAck { - const message = { ...baseMsgChannelOpenAck } as MsgChannelOpenAck; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if ( - object.counterparty_channel_id !== undefined && - object.counterparty_channel_id !== null - ) { - message.counterparty_channel_id = String(object.counterparty_channel_id); - } else { - message.counterparty_channel_id = ""; - } - if ( - object.counterparty_version !== undefined && - object.counterparty_version !== null - ) { - message.counterparty_version = String(object.counterparty_version); - } else { - message.counterparty_version = ""; - } - if (object.proof_try !== undefined && object.proof_try !== null) { - message.proof_try = bytesFromBase64(object.proof_try); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgChannelOpenAck): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.counterparty_channel_id !== undefined && - (obj.counterparty_channel_id = message.counterparty_channel_id); - message.counterparty_version !== undefined && - (obj.counterparty_version = message.counterparty_version); - message.proof_try !== undefined && - (obj.proof_try = base64FromBytes( - message.proof_try !== undefined ? message.proof_try : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgChannelOpenAck { - const message = { ...baseMsgChannelOpenAck } as MsgChannelOpenAck; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if ( - object.counterparty_channel_id !== undefined && - object.counterparty_channel_id !== null - ) { - message.counterparty_channel_id = object.counterparty_channel_id; - } else { - message.counterparty_channel_id = ""; - } - if ( - object.counterparty_version !== undefined && - object.counterparty_version !== null - ) { - message.counterparty_version = object.counterparty_version; - } else { - message.counterparty_version = ""; - } - if (object.proof_try !== undefined && object.proof_try !== null) { - message.proof_try = object.proof_try; - } else { - message.proof_try = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgChannelOpenAckResponse: object = {}; - -export const MsgChannelOpenAckResponse = { - encode( - _: MsgChannelOpenAckResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgChannelOpenAckResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgChannelOpenAckResponse, - } as MsgChannelOpenAckResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgChannelOpenAckResponse { - const message = { - ...baseMsgChannelOpenAckResponse, - } as MsgChannelOpenAckResponse; - return message; - }, - - toJSON(_: MsgChannelOpenAckResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgChannelOpenAckResponse { - const message = { - ...baseMsgChannelOpenAckResponse, - } as MsgChannelOpenAckResponse; - return message; - }, -}; - -const baseMsgChannelOpenConfirm: object = { - port_id: "", - channel_id: "", - signer: "", -}; - -export const MsgChannelOpenConfirm = { - encode( - message: MsgChannelOpenConfirm, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.proof_ack.length !== 0) { - writer.uint32(26).bytes(message.proof_ack); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(34).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(42).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgChannelOpenConfirm { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgChannelOpenConfirm } as MsgChannelOpenConfirm; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.proof_ack = reader.bytes(); - break; - case 4: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgChannelOpenConfirm { - const message = { ...baseMsgChannelOpenConfirm } as MsgChannelOpenConfirm; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.proof_ack !== undefined && object.proof_ack !== null) { - message.proof_ack = bytesFromBase64(object.proof_ack); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgChannelOpenConfirm): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.proof_ack !== undefined && - (obj.proof_ack = base64FromBytes( - message.proof_ack !== undefined ? message.proof_ack : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgChannelOpenConfirm { - const message = { ...baseMsgChannelOpenConfirm } as MsgChannelOpenConfirm; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.proof_ack !== undefined && object.proof_ack !== null) { - message.proof_ack = object.proof_ack; - } else { - message.proof_ack = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgChannelOpenConfirmResponse: object = {}; - -export const MsgChannelOpenConfirmResponse = { - encode( - _: MsgChannelOpenConfirmResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgChannelOpenConfirmResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgChannelOpenConfirmResponse, - } as MsgChannelOpenConfirmResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgChannelOpenConfirmResponse { - const message = { - ...baseMsgChannelOpenConfirmResponse, - } as MsgChannelOpenConfirmResponse; - return message; - }, - - toJSON(_: MsgChannelOpenConfirmResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgChannelOpenConfirmResponse { - const message = { - ...baseMsgChannelOpenConfirmResponse, - } as MsgChannelOpenConfirmResponse; - return message; - }, -}; - -const baseMsgChannelCloseInit: object = { - port_id: "", - channel_id: "", - signer: "", -}; - -export const MsgChannelCloseInit = { - encode( - message: MsgChannelCloseInit, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.signer !== "") { - writer.uint32(26).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgChannelCloseInit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgChannelCloseInit } as MsgChannelCloseInit; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgChannelCloseInit { - const message = { ...baseMsgChannelCloseInit } as MsgChannelCloseInit; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgChannelCloseInit): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgChannelCloseInit { - const message = { ...baseMsgChannelCloseInit } as MsgChannelCloseInit; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgChannelCloseInitResponse: object = {}; - -export const MsgChannelCloseInitResponse = { - encode( - _: MsgChannelCloseInitResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgChannelCloseInitResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgChannelCloseInitResponse, - } as MsgChannelCloseInitResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgChannelCloseInitResponse { - const message = { - ...baseMsgChannelCloseInitResponse, - } as MsgChannelCloseInitResponse; - return message; - }, - - toJSON(_: MsgChannelCloseInitResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgChannelCloseInitResponse { - const message = { - ...baseMsgChannelCloseInitResponse, - } as MsgChannelCloseInitResponse; - return message; - }, -}; - -const baseMsgChannelCloseConfirm: object = { - port_id: "", - channel_id: "", - signer: "", -}; - -export const MsgChannelCloseConfirm = { - encode( - message: MsgChannelCloseConfirm, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.proof_init.length !== 0) { - writer.uint32(26).bytes(message.proof_init); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(34).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(42).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgChannelCloseConfirm { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgChannelCloseConfirm } as MsgChannelCloseConfirm; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.proof_init = reader.bytes(); - break; - case 4: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgChannelCloseConfirm { - const message = { ...baseMsgChannelCloseConfirm } as MsgChannelCloseConfirm; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.proof_init !== undefined && object.proof_init !== null) { - message.proof_init = bytesFromBase64(object.proof_init); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgChannelCloseConfirm): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.proof_init !== undefined && - (obj.proof_init = base64FromBytes( - message.proof_init !== undefined ? message.proof_init : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgChannelCloseConfirm { - const message = { ...baseMsgChannelCloseConfirm } as MsgChannelCloseConfirm; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.proof_init !== undefined && object.proof_init !== null) { - message.proof_init = object.proof_init; - } else { - message.proof_init = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgChannelCloseConfirmResponse: object = {}; - -export const MsgChannelCloseConfirmResponse = { - encode( - _: MsgChannelCloseConfirmResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgChannelCloseConfirmResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgChannelCloseConfirmResponse, - } as MsgChannelCloseConfirmResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgChannelCloseConfirmResponse { - const message = { - ...baseMsgChannelCloseConfirmResponse, - } as MsgChannelCloseConfirmResponse; - return message; - }, - - toJSON(_: MsgChannelCloseConfirmResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgChannelCloseConfirmResponse { - const message = { - ...baseMsgChannelCloseConfirmResponse, - } as MsgChannelCloseConfirmResponse; - return message; - }, -}; - -const baseMsgRecvPacket: object = { signer: "" }; - -export const MsgRecvPacket = { - encode(message: MsgRecvPacket, writer: Writer = Writer.create()): Writer { - if (message.packet !== undefined) { - Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); - } - if (message.proof_commitment.length !== 0) { - writer.uint32(18).bytes(message.proof_commitment); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(34).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgRecvPacket { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgRecvPacket } as MsgRecvPacket; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = Packet.decode(reader, reader.uint32()); - break; - case 2: - message.proof_commitment = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 4: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgRecvPacket { - const message = { ...baseMsgRecvPacket } as MsgRecvPacket; - if (object.packet !== undefined && object.packet !== null) { - message.packet = Packet.fromJSON(object.packet); - } else { - message.packet = undefined; - } - if ( - object.proof_commitment !== undefined && - object.proof_commitment !== null - ) { - message.proof_commitment = bytesFromBase64(object.proof_commitment); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgRecvPacket): unknown { - const obj: any = {}; - message.packet !== undefined && - (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); - message.proof_commitment !== undefined && - (obj.proof_commitment = base64FromBytes( - message.proof_commitment !== undefined - ? message.proof_commitment - : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgRecvPacket { - const message = { ...baseMsgRecvPacket } as MsgRecvPacket; - if (object.packet !== undefined && object.packet !== null) { - message.packet = Packet.fromPartial(object.packet); - } else { - message.packet = undefined; - } - if ( - object.proof_commitment !== undefined && - object.proof_commitment !== null - ) { - message.proof_commitment = object.proof_commitment; - } else { - message.proof_commitment = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgRecvPacketResponse: object = {}; - -export const MsgRecvPacketResponse = { - encode(_: MsgRecvPacketResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgRecvPacketResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgRecvPacketResponse } as MsgRecvPacketResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgRecvPacketResponse { - const message = { ...baseMsgRecvPacketResponse } as MsgRecvPacketResponse; - return message; - }, - - toJSON(_: MsgRecvPacketResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgRecvPacketResponse { - const message = { ...baseMsgRecvPacketResponse } as MsgRecvPacketResponse; - return message; - }, -}; - -const baseMsgTimeout: object = { next_sequence_recv: 0, signer: "" }; - -export const MsgTimeout = { - encode(message: MsgTimeout, writer: Writer = Writer.create()): Writer { - if (message.packet !== undefined) { - Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); - } - if (message.proof_unreceived.length !== 0) { - writer.uint32(18).bytes(message.proof_unreceived); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - if (message.next_sequence_recv !== 0) { - writer.uint32(32).uint64(message.next_sequence_recv); - } - if (message.signer !== "") { - writer.uint32(42).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgTimeout { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgTimeout } as MsgTimeout; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = Packet.decode(reader, reader.uint32()); - break; - case 2: - message.proof_unreceived = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 4: - message.next_sequence_recv = longToNumber(reader.uint64() as Long); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgTimeout { - const message = { ...baseMsgTimeout } as MsgTimeout; - if (object.packet !== undefined && object.packet !== null) { - message.packet = Packet.fromJSON(object.packet); - } else { - message.packet = undefined; - } - if ( - object.proof_unreceived !== undefined && - object.proof_unreceived !== null - ) { - message.proof_unreceived = bytesFromBase64(object.proof_unreceived); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if ( - object.next_sequence_recv !== undefined && - object.next_sequence_recv !== null - ) { - message.next_sequence_recv = Number(object.next_sequence_recv); - } else { - message.next_sequence_recv = 0; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgTimeout): unknown { - const obj: any = {}; - message.packet !== undefined && - (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); - message.proof_unreceived !== undefined && - (obj.proof_unreceived = base64FromBytes( - message.proof_unreceived !== undefined - ? message.proof_unreceived - : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.next_sequence_recv !== undefined && - (obj.next_sequence_recv = message.next_sequence_recv); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgTimeout { - const message = { ...baseMsgTimeout } as MsgTimeout; - if (object.packet !== undefined && object.packet !== null) { - message.packet = Packet.fromPartial(object.packet); - } else { - message.packet = undefined; - } - if ( - object.proof_unreceived !== undefined && - object.proof_unreceived !== null - ) { - message.proof_unreceived = object.proof_unreceived; - } else { - message.proof_unreceived = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if ( - object.next_sequence_recv !== undefined && - object.next_sequence_recv !== null - ) { - message.next_sequence_recv = object.next_sequence_recv; - } else { - message.next_sequence_recv = 0; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgTimeoutResponse: object = {}; - -export const MsgTimeoutResponse = { - encode(_: MsgTimeoutResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgTimeoutResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgTimeoutResponse } as MsgTimeoutResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgTimeoutResponse { - const message = { ...baseMsgTimeoutResponse } as MsgTimeoutResponse; - return message; - }, - - toJSON(_: MsgTimeoutResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgTimeoutResponse { - const message = { ...baseMsgTimeoutResponse } as MsgTimeoutResponse; - return message; - }, -}; - -const baseMsgTimeoutOnClose: object = { next_sequence_recv: 0, signer: "" }; - -export const MsgTimeoutOnClose = { - encode(message: MsgTimeoutOnClose, writer: Writer = Writer.create()): Writer { - if (message.packet !== undefined) { - Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); - } - if (message.proof_unreceived.length !== 0) { - writer.uint32(18).bytes(message.proof_unreceived); - } - if (message.proof_close.length !== 0) { - writer.uint32(26).bytes(message.proof_close); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(34).fork()).ldelim(); - } - if (message.next_sequence_recv !== 0) { - writer.uint32(40).uint64(message.next_sequence_recv); - } - if (message.signer !== "") { - writer.uint32(50).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgTimeoutOnClose { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgTimeoutOnClose } as MsgTimeoutOnClose; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = Packet.decode(reader, reader.uint32()); - break; - case 2: - message.proof_unreceived = reader.bytes(); - break; - case 3: - message.proof_close = reader.bytes(); - break; - case 4: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 5: - message.next_sequence_recv = longToNumber(reader.uint64() as Long); - break; - case 6: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgTimeoutOnClose { - const message = { ...baseMsgTimeoutOnClose } as MsgTimeoutOnClose; - if (object.packet !== undefined && object.packet !== null) { - message.packet = Packet.fromJSON(object.packet); - } else { - message.packet = undefined; - } - if ( - object.proof_unreceived !== undefined && - object.proof_unreceived !== null - ) { - message.proof_unreceived = bytesFromBase64(object.proof_unreceived); - } - if (object.proof_close !== undefined && object.proof_close !== null) { - message.proof_close = bytesFromBase64(object.proof_close); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if ( - object.next_sequence_recv !== undefined && - object.next_sequence_recv !== null - ) { - message.next_sequence_recv = Number(object.next_sequence_recv); - } else { - message.next_sequence_recv = 0; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgTimeoutOnClose): unknown { - const obj: any = {}; - message.packet !== undefined && - (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); - message.proof_unreceived !== undefined && - (obj.proof_unreceived = base64FromBytes( - message.proof_unreceived !== undefined - ? message.proof_unreceived - : new Uint8Array() - )); - message.proof_close !== undefined && - (obj.proof_close = base64FromBytes( - message.proof_close !== undefined - ? message.proof_close - : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.next_sequence_recv !== undefined && - (obj.next_sequence_recv = message.next_sequence_recv); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgTimeoutOnClose { - const message = { ...baseMsgTimeoutOnClose } as MsgTimeoutOnClose; - if (object.packet !== undefined && object.packet !== null) { - message.packet = Packet.fromPartial(object.packet); - } else { - message.packet = undefined; - } - if ( - object.proof_unreceived !== undefined && - object.proof_unreceived !== null - ) { - message.proof_unreceived = object.proof_unreceived; - } else { - message.proof_unreceived = new Uint8Array(); - } - if (object.proof_close !== undefined && object.proof_close !== null) { - message.proof_close = object.proof_close; - } else { - message.proof_close = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if ( - object.next_sequence_recv !== undefined && - object.next_sequence_recv !== null - ) { - message.next_sequence_recv = object.next_sequence_recv; - } else { - message.next_sequence_recv = 0; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgTimeoutOnCloseResponse: object = {}; - -export const MsgTimeoutOnCloseResponse = { - encode( - _: MsgTimeoutOnCloseResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgTimeoutOnCloseResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgTimeoutOnCloseResponse, - } as MsgTimeoutOnCloseResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgTimeoutOnCloseResponse { - const message = { - ...baseMsgTimeoutOnCloseResponse, - } as MsgTimeoutOnCloseResponse; - return message; - }, - - toJSON(_: MsgTimeoutOnCloseResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgTimeoutOnCloseResponse { - const message = { - ...baseMsgTimeoutOnCloseResponse, - } as MsgTimeoutOnCloseResponse; - return message; - }, -}; - -const baseMsgAcknowledgement: object = { signer: "" }; - -export const MsgAcknowledgement = { - encode( - message: MsgAcknowledgement, - writer: Writer = Writer.create() - ): Writer { - if (message.packet !== undefined) { - Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); - } - if (message.acknowledgement.length !== 0) { - writer.uint32(18).bytes(message.acknowledgement); - } - if (message.proof_acked.length !== 0) { - writer.uint32(26).bytes(message.proof_acked); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(34).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(42).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgAcknowledgement { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgAcknowledgement } as MsgAcknowledgement; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = Packet.decode(reader, reader.uint32()); - break; - case 2: - message.acknowledgement = reader.bytes(); - break; - case 3: - message.proof_acked = reader.bytes(); - break; - case 4: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgAcknowledgement { - const message = { ...baseMsgAcknowledgement } as MsgAcknowledgement; - if (object.packet !== undefined && object.packet !== null) { - message.packet = Packet.fromJSON(object.packet); - } else { - message.packet = undefined; - } - if ( - object.acknowledgement !== undefined && - object.acknowledgement !== null - ) { - message.acknowledgement = bytesFromBase64(object.acknowledgement); - } - if (object.proof_acked !== undefined && object.proof_acked !== null) { - message.proof_acked = bytesFromBase64(object.proof_acked); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgAcknowledgement): unknown { - const obj: any = {}; - message.packet !== undefined && - (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); - message.acknowledgement !== undefined && - (obj.acknowledgement = base64FromBytes( - message.acknowledgement !== undefined - ? message.acknowledgement - : new Uint8Array() - )); - message.proof_acked !== undefined && - (obj.proof_acked = base64FromBytes( - message.proof_acked !== undefined - ? message.proof_acked - : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgAcknowledgement { - const message = { ...baseMsgAcknowledgement } as MsgAcknowledgement; - if (object.packet !== undefined && object.packet !== null) { - message.packet = Packet.fromPartial(object.packet); - } else { - message.packet = undefined; - } - if ( - object.acknowledgement !== undefined && - object.acknowledgement !== null - ) { - message.acknowledgement = object.acknowledgement; - } else { - message.acknowledgement = new Uint8Array(); - } - if (object.proof_acked !== undefined && object.proof_acked !== null) { - message.proof_acked = object.proof_acked; - } else { - message.proof_acked = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgAcknowledgementResponse: object = {}; - -export const MsgAcknowledgementResponse = { - encode( - _: MsgAcknowledgementResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgAcknowledgementResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgAcknowledgementResponse, - } as MsgAcknowledgementResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgAcknowledgementResponse { - const message = { - ...baseMsgAcknowledgementResponse, - } as MsgAcknowledgementResponse; - return message; - }, - - toJSON(_: MsgAcknowledgementResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgAcknowledgementResponse { - const message = { - ...baseMsgAcknowledgementResponse, - } as MsgAcknowledgementResponse; - return message; - }, -}; - -/** Msg defines the ibc/channel Msg service. */ -export interface Msg { - /** ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. */ - ChannelOpenInit( - request: MsgChannelOpenInit - ): Promise; - /** ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. */ - ChannelOpenTry( - request: MsgChannelOpenTry - ): Promise; - /** ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. */ - ChannelOpenAck( - request: MsgChannelOpenAck - ): Promise; - /** ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. */ - ChannelOpenConfirm( - request: MsgChannelOpenConfirm - ): Promise; - /** ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. */ - ChannelCloseInit( - request: MsgChannelCloseInit - ): Promise; - /** - * ChannelCloseConfirm defines a rpc handler method for - * MsgChannelCloseConfirm. - */ - ChannelCloseConfirm( - request: MsgChannelCloseConfirm - ): Promise; - /** RecvPacket defines a rpc handler method for MsgRecvPacket. */ - RecvPacket(request: MsgRecvPacket): Promise; - /** Timeout defines a rpc handler method for MsgTimeout. */ - Timeout(request: MsgTimeout): Promise; - /** TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. */ - TimeoutOnClose( - request: MsgTimeoutOnClose - ): Promise; - /** Acknowledgement defines a rpc handler method for MsgAcknowledgement. */ - Acknowledgement( - request: MsgAcknowledgement - ): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - ChannelOpenInit( - request: MsgChannelOpenInit - ): Promise { - const data = MsgChannelOpenInit.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "ChannelOpenInit", - data - ); - return promise.then((data) => - MsgChannelOpenInitResponse.decode(new Reader(data)) - ); - } - - ChannelOpenTry( - request: MsgChannelOpenTry - ): Promise { - const data = MsgChannelOpenTry.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "ChannelOpenTry", - data - ); - return promise.then((data) => - MsgChannelOpenTryResponse.decode(new Reader(data)) - ); - } - - ChannelOpenAck( - request: MsgChannelOpenAck - ): Promise { - const data = MsgChannelOpenAck.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "ChannelOpenAck", - data - ); - return promise.then((data) => - MsgChannelOpenAckResponse.decode(new Reader(data)) - ); - } - - ChannelOpenConfirm( - request: MsgChannelOpenConfirm - ): Promise { - const data = MsgChannelOpenConfirm.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "ChannelOpenConfirm", - data - ); - return promise.then((data) => - MsgChannelOpenConfirmResponse.decode(new Reader(data)) - ); - } - - ChannelCloseInit( - request: MsgChannelCloseInit - ): Promise { - const data = MsgChannelCloseInit.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "ChannelCloseInit", - data - ); - return promise.then((data) => - MsgChannelCloseInitResponse.decode(new Reader(data)) - ); - } - - ChannelCloseConfirm( - request: MsgChannelCloseConfirm - ): Promise { - const data = MsgChannelCloseConfirm.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "ChannelCloseConfirm", - data - ); - return promise.then((data) => - MsgChannelCloseConfirmResponse.decode(new Reader(data)) - ); - } - - RecvPacket(request: MsgRecvPacket): Promise { - const data = MsgRecvPacket.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "RecvPacket", - data - ); - return promise.then((data) => - MsgRecvPacketResponse.decode(new Reader(data)) - ); - } - - Timeout(request: MsgTimeout): Promise { - const data = MsgTimeout.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "Timeout", - data - ); - return promise.then((data) => MsgTimeoutResponse.decode(new Reader(data))); - } - - TimeoutOnClose( - request: MsgTimeoutOnClose - ): Promise { - const data = MsgTimeoutOnClose.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "TimeoutOnClose", - data - ); - return promise.then((data) => - MsgTimeoutOnCloseResponse.decode(new Reader(data)) - ); - } - - Acknowledgement( - request: MsgAcknowledgement - ): Promise { - const data = MsgAcknowledgement.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.channel.v1.Msg", - "Acknowledgement", - data - ); - return promise.then((data) => - MsgAcknowledgementResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/client/v1/client.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/client/v1/client.ts deleted file mode 100644 index b34686d3..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/module/types/ibc/core/client/v1/client.ts +++ /dev/null @@ -1,814 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; - -export const protobufPackage = "ibc.core.client.v1"; - -/** - * IdentifiedClientState defines a client state with an additional client - * identifier field. - */ -export interface IdentifiedClientState { - /** client identifier */ - client_id: string; - /** client state */ - client_state: Any | undefined; -} - -/** - * ConsensusStateWithHeight defines a consensus state with an additional height - * field. - */ -export interface ConsensusStateWithHeight { - /** consensus state height */ - height: Height | undefined; - /** consensus state */ - consensus_state: Any | undefined; -} - -/** - * ClientConsensusStates defines all the stored consensus states for a given - * client. - */ -export interface ClientConsensusStates { - /** client identifier */ - client_id: string; - /** consensus states and their heights associated with the client */ - consensus_states: ConsensusStateWithHeight[]; -} - -/** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute - * client's latest consensus state is copied over to the subject client. The proposal - * handler may fail if the subject and the substitute do not match in client and - * chain parameters (with exception to latest height, frozen height, and chain-id). - */ -export interface ClientUpdateProposal { - /** the title of the update proposal */ - title: string; - /** the description of the proposal */ - description: string; - /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id: string; - /** - * the substitute client identifier for the client standing in for the subject - * client - */ - substitute_client_id: string; -} - -/** - * UpgradeProposal is a gov Content type for initiating an IBC breaking - * upgrade. - */ -export interface UpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; - /** - * An UpgradedClientState must be provided to perform an IBC breaking upgrade. - * This will make the chain commit to the correct upgraded (self) client state - * before the upgrade occurs, so that connecting chains can verify that the - * new upgraded client is valid by verifying a proof on the previous version - * of the chain. This will allow IBC connections to persist smoothly across - * planned chain upgrades - */ - upgraded_client_state: Any | undefined; -} - -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface Height { - /** the revision that the client is currently on */ - revision_number: number; - /** the height within the given revision */ - revision_height: number; -} - -/** Params defines the set of IBC light client parameters. */ -export interface Params { - /** allowed_clients defines the list of allowed client state types. */ - allowed_clients: string[]; -} - -const baseIdentifiedClientState: object = { client_id: "" }; - -export const IdentifiedClientState = { - encode( - message: IdentifiedClientState, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IdentifiedClientState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, - - toJSON(message: IdentifiedClientState): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, -}; - -const baseConsensusStateWithHeight: object = {}; - -export const ConsensusStateWithHeight = { - encode( - message: ConsensusStateWithHeight, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(10).fork()).ldelim(); - } - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ConsensusStateWithHeight { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = Height.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, - - toJSON(message: ConsensusStateWithHeight): unknown { - const obj: any = {}; - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, -}; - -const baseClientConsensusStates: object = { client_id: "" }; - -export const ClientConsensusStates = { - encode( - message: ClientConsensusStates, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - for (const v of message.consensus_states) { - ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientConsensusStates { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.consensus_states.push( - ConsensusStateWithHeight.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ClientConsensusStates): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - if (message.consensus_states) { - obj.consensus_states = message.consensus_states.map((e) => - e ? ConsensusStateWithHeight.toJSON(e) : undefined - ); - } else { - obj.consensus_states = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromPartial(e)); - } - } - return message; - }, -}; - -const baseClientUpdateProposal: object = { - title: "", - description: "", - subject_client_id: "", - substitute_client_id: "", -}; - -export const ClientUpdateProposal = { - encode( - message: ClientUpdateProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.subject_client_id !== "") { - writer.uint32(26).string(message.subject_client_id); - } - if (message.substitute_client_id !== "") { - writer.uint32(34).string(message.substitute_client_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientUpdateProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.subject_client_id = reader.string(); - break; - case 4: - message.substitute_client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = String(object.subject_client_id); - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = String(object.substitute_client_id); - } else { - message.substitute_client_id = ""; - } - return message; - }, - - toJSON(message: ClientUpdateProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.subject_client_id !== undefined && - (obj.subject_client_id = message.subject_client_id); - message.substitute_client_id !== undefined && - (obj.substitute_client_id = message.substitute_client_id); - return obj; - }, - - fromPartial(object: DeepPartial): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = object.subject_client_id; - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = object.substitute_client_id; - } else { - message.substitute_client_id = ""; - } - return message; - }, -}; - -const baseUpgradeProposal: object = { title: "", description: "" }; - -export const UpgradeProposal = { - encode(message: UpgradeProposal, writer: Writer = Writer.create()): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - if (message.upgraded_client_state !== undefined) { - Any.encode( - message.upgraded_client_state, - writer.uint32(34).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUpgradeProposal } as UpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgraded_client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromJSON( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, - - toJSON(message: UpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - message.upgraded_client_state !== undefined && - (obj.upgraded_client_state = message.upgraded_client_state - ? Any.toJSON(message.upgraded_client_state) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromPartial( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, -}; - -const baseHeight: object = { revision_number: 0, revision_height: 0 }; - -export const Height = { - encode(message: Height, writer: Writer = Writer.create()): Writer { - if (message.revision_number !== 0) { - writer.uint32(8).uint64(message.revision_number); - } - if (message.revision_height !== 0) { - writer.uint32(16).uint64(message.revision_height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Height { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeight } as Height; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revision_number = longToNumber(reader.uint64() as Long); - break; - case 2: - message.revision_height = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = Number(object.revision_number); - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = Number(object.revision_height); - } else { - message.revision_height = 0; - } - return message; - }, - - toJSON(message: Height): unknown { - const obj: any = {}; - message.revision_number !== undefined && - (obj.revision_number = message.revision_number); - message.revision_height !== undefined && - (obj.revision_height = message.revision_height); - return obj; - }, - - fromPartial(object: DeepPartial): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = object.revision_number; - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = object.revision_height; - } else { - message.revision_height = 0; - } - return message; - }, -}; - -const baseParams: object = { allowed_clients: "" }; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - for (const v of message.allowed_clients) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - message.allowed_clients = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowed_clients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(String(e)); - } - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - if (message.allowed_clients) { - obj.allowed_clients = message.allowed_clients.map((e) => e); - } else { - obj.allowed_clients = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(e); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/package.json b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/package.json deleted file mode 100644 index bc26a76a..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "ibc-core-channel-v1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module ibc.core.channel.v1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/ibc-go/v2/modules/core/04-channel/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/vuex-root b/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.channel.v1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/index.ts deleted file mode 100644 index 3db067f7..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/index.ts +++ /dev/null @@ -1,372 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { IdentifiedClientState } from "./module/types/ibc/core/client/v1/client" -import { ConsensusStateWithHeight } from "./module/types/ibc/core/client/v1/client" -import { ClientConsensusStates } from "./module/types/ibc/core/client/v1/client" -import { ClientUpdateProposal } from "./module/types/ibc/core/client/v1/client" -import { UpgradeProposal } from "./module/types/ibc/core/client/v1/client" -import { Height } from "./module/types/ibc/core/client/v1/client" -import { Params } from "./module/types/ibc/core/client/v1/client" -import { GenesisMetadata } from "./module/types/ibc/core/client/v1/genesis" -import { IdentifiedGenesisMetadata } from "./module/types/ibc/core/client/v1/genesis" - - -export { IdentifiedClientState, ConsensusStateWithHeight, ClientConsensusStates, ClientUpdateProposal, UpgradeProposal, Height, Params, GenesisMetadata, IdentifiedGenesisMetadata }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - ClientState: {}, - ClientStates: {}, - ConsensusState: {}, - ConsensusStates: {}, - ClientStatus: {}, - ClientParams: {}, - UpgradedClientState: {}, - UpgradedConsensusState: {}, - - _Structure: { - IdentifiedClientState: getStructure(IdentifiedClientState.fromPartial({})), - ConsensusStateWithHeight: getStructure(ConsensusStateWithHeight.fromPartial({})), - ClientConsensusStates: getStructure(ClientConsensusStates.fromPartial({})), - ClientUpdateProposal: getStructure(ClientUpdateProposal.fromPartial({})), - UpgradeProposal: getStructure(UpgradeProposal.fromPartial({})), - Height: getStructure(Height.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - GenesisMetadata: getStructure(GenesisMetadata.fromPartial({})), - IdentifiedGenesisMetadata: getStructure(IdentifiedGenesisMetadata.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getClientState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientState[JSON.stringify(params)] ?? {} - }, - getClientStates: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientStates[JSON.stringify(params)] ?? {} - }, - getConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConsensusState[JSON.stringify(params)] ?? {} - }, - getConsensusStates: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConsensusStates[JSON.stringify(params)] ?? {} - }, - getClientStatus: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientStatus[JSON.stringify(params)] ?? {} - }, - getClientParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientParams[JSON.stringify(params)] ?? {} - }, - getUpgradedClientState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UpgradedClientState[JSON.stringify(params)] ?? {} - }, - getUpgradedConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UpgradedConsensusState[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.core.client.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryClientState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryClientState( key.client_id)).data - - - commit('QUERY', { query: 'ClientState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientState', payload: { options: { all }, params: {...key},query }}) - return getters['getClientState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClientStates({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryClientStates(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryClientStates({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ClientStates', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientStates', payload: { options: { all }, params: {...key},query }}) - return getters['getClientStates']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientStates API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryConsensusState( key.client_id, key.revision_number, key.revision_height, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryConsensusState( key.client_id, key.revision_number, key.revision_height, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConsensusStates({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryConsensusStates( key.client_id, query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryConsensusStates( key.client_id, {...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ConsensusStates', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConsensusStates', payload: { options: { all }, params: {...key},query }}) - return getters['getConsensusStates']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConsensusStates API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClientStatus({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryClientStatus( key.client_id)).data - - - commit('QUERY', { query: 'ClientStatus', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientStatus', payload: { options: { all }, params: {...key},query }}) - return getters['getClientStatus']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientStatus API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClientParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryClientParams()).data - - - commit('QUERY', { query: 'ClientParams', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientParams', payload: { options: { all }, params: {...key},query }}) - return getters['getClientParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUpgradedClientState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryUpgradedClientState()).data - - - commit('QUERY', { query: 'UpgradedClientState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUpgradedClientState', payload: { options: { all }, params: {...key},query }}) - return getters['getUpgradedClientState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUpgradedClientState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUpgradedConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryUpgradedConsensusState()).data - - - commit('QUERY', { query: 'UpgradedConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUpgradedConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getUpgradedConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUpgradedConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/rest.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/rest.ts deleted file mode 100644 index 5e397ea2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/rest.ts +++ /dev/null @@ -1,1227 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* ConsensusStateWithHeight defines a consensus state with an additional height -field. -*/ -export interface V1ConsensusStateWithHeight { - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - height?: V1Height; - - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - consensus_state?: ProtobufAny; -} - -/** -* Normally the RevisionHeight is incremented at each height while keeping -RevisionNumber the same. However some consensus algorithms may choose to -reset the height in certain conditions e.g. hard forks, state-machine -breaking changes In these cases, the RevisionNumber is incremented so that -height continues to be monitonically increasing even as the RevisionHeight -gets reset -*/ -export interface V1Height { - /** @format uint64 */ - revision_number?: string; - - /** @format uint64 */ - revision_height?: string; -} - -/** -* IdentifiedClientState defines a client state with an additional client -identifier field. -*/ -export interface V1IdentifiedClientState { - client_id?: string; - - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - client_state?: ProtobufAny; -} - -/** - * MsgCreateClientResponse defines the Msg/CreateClient response type. - */ -export type V1MsgCreateClientResponse = object; - -/** -* MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response -type. -*/ -export type V1MsgSubmitMisbehaviourResponse = object; - -/** - * MsgUpdateClientResponse defines the Msg/UpdateClient response type. - */ -export type V1MsgUpdateClientResponse = object; - -/** - * MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. - */ -export type V1MsgUpgradeClientResponse = object; - -/** - * Params defines the set of IBC light client parameters. - */ -export interface V1Params { - /** allowed_clients defines the list of allowed client state types. */ - allowed_clients?: string[]; -} - -/** -* QueryClientParamsResponse is the response type for the Query/ClientParams RPC -method. -*/ -export interface V1QueryClientParamsResponse { - /** params defines the parameters of the module. */ - params?: V1Params; -} - -/** -* QueryClientStateResponse is the response type for the Query/ClientState RPC -method. Besides the client state, it includes a proof and the height from -which the proof was retrieved. -*/ -export interface V1QueryClientStateResponse { - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - client_state?: ProtobufAny; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -/** -* QueryClientStatesResponse is the response type for the Query/ClientStates RPC -method. -*/ -export interface V1QueryClientStatesResponse { - /** list of stored ClientStates of the chain. */ - client_states?: V1IdentifiedClientState[]; - - /** - * 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; - * } - */ - pagination?: V1Beta1PageResponse; -} - -/** -* QueryClientStatusResponse is the response type for the Query/ClientStatus RPC -method. It returns the current status of the IBC client. -*/ -export interface V1QueryClientStatusResponse { - status?: string; -} - -export interface V1QueryConsensusStateResponse { - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - consensus_state?: ProtobufAny; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -export interface V1QueryConsensusStatesResponse { - consensus_states?: V1ConsensusStateWithHeight[]; - - /** - * 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; - * } - */ - pagination?: V1Beta1PageResponse; -} - -/** -* QueryUpgradedClientStateResponse is the response type for the -Query/UpgradedClientState RPC method. -*/ -export interface V1QueryUpgradedClientStateResponse { - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - upgraded_client_state?: ProtobufAny; -} - -/** -* QueryUpgradedConsensusStateResponse is the response type for the -Query/UpgradedConsensusState RPC method. -*/ -export interface V1QueryUpgradedConsensusStateResponse { - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - upgraded_consensus_state?: ProtobufAny; -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title ibc/core/client/v1/client.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryClientParams - * @summary ClientParams queries all parameters of the ibc client. - * @request GET:/ibc/client/v1/params - */ - queryClientParams = (params: RequestParams = {}) => - this.request({ - path: `/ibc/client/v1/params`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryClientStates - * @summary ClientStates queries all the IBC light clients of a chain. - * @request GET:/ibc/core/client/v1/client_states - */ - queryClientStates = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/client/v1/client_states`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryClientState - * @summary ClientState queries an IBC light client. - * @request GET:/ibc/core/client/v1/client_states/{client_id} - */ - queryClientState = (client_id: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/client/v1/client_states/${client_id}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryClientStatus - * @summary Status queries the status of an IBC client. - * @request GET:/ibc/core/client/v1/client_status/{client_id} - */ - queryClientStatus = (client_id: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/client/v1/client_status/${client_id}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryConsensusStates - * @summary ConsensusStates queries all the consensus state associated with a given -client. - * @request GET:/ibc/core/client/v1/consensus_states/{client_id} - */ - queryConsensusStates = ( - client_id: string, - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/client/v1/consensus_states/${client_id}`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryConsensusState - * @summary ConsensusState queries a consensus state associated with a client state at -a given height. - * @request GET:/ibc/core/client/v1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height} - */ - queryConsensusState = ( - client_id: string, - revision_number: string, - revision_height: string, - query?: { latest_height?: boolean }, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/client/v1/consensus_states/${client_id}/revision/${revision_number}/height/${revision_height}`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryUpgradedClientState - * @summary UpgradedClientState queries an Upgraded IBC light client. - * @request GET:/ibc/core/client/v1/upgraded_client_states - */ - queryUpgradedClientState = (params: RequestParams = {}) => - this.request({ - path: `/ibc/core/client/v1/upgraded_client_states`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryUpgradedConsensusState - * @summary UpgradedConsensusState queries an Upgraded IBC consensus state. - * @request GET:/ibc/core/client/v1/upgraded_consensus_states - */ - queryUpgradedConsensusState = (params: RequestParams = {}) => - this.request({ - path: `/ibc/core/client/v1/upgraded_consensus_states`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 0bc568f4..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,300 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { offset: 0, limit: 0, count_total: false }; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts deleted file mode 100644 index e9cefea2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts +++ /dev/null @@ -1,414 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.upgrade.v1beta1"; - -/** Plan specifies information about a planned upgrade and when it should occur. */ -export interface Plan { - /** - * Sets the name for the upgrade. This name will be used by the upgraded - * version of the software to apply any special "on-upgrade" commands during - * the first BeginBlock method after the upgrade is applied. It is also used - * to detect whether a software version can handle a given upgrade. If no - * upgrade handler with this name has been set in the software, it will be - * assumed that the software is out-of-date when the upgrade Time or Height is - * reached and the software will exit. - */ - name: string; - /** - * The time after which the upgrade must be performed. - * Leave set to its zero value to use a pre-defined Height instead. - */ - time: Date | undefined; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ - height: number; - /** - * Any application specific upgrade info to be included on-chain - * such as a git commit that validators could automatically upgrade to - */ - info: string; -} - -/** - * SoftwareUpgradeProposal is a gov Content type for initiating a software - * upgrade. - */ -export interface SoftwareUpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; -} - -/** - * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software - * upgrade. - */ -export interface CancelSoftwareUpgradeProposal { - title: string; - description: string; -} - -const basePlan: object = { name: "", height: 0, info: "" }; - -export const Plan = { - encode(message: Plan, writer: Writer = Writer.create()): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePlan } as Plan; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - return message; - }, - - toJSON(message: Plan): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.height !== undefined && (obj.height = message.height); - message.info !== undefined && (obj.info = message.info); - return obj; - }, - - fromPartial(object: DeepPartial): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - return message; - }, -}; - -const baseSoftwareUpgradeProposal: object = { title: "", description: "" }; - -export const SoftwareUpgradeProposal = { - encode( - message: SoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - return message; - }, - - toJSON(message: SoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - return message; - }, -}; - -const baseCancelSoftwareUpgradeProposal: object = { - title: "", - description: "", -}; - -export const CancelSoftwareUpgradeProposal = { - encode( - message: CancelSoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CancelSoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - return message; - }, - - toJSON(message: CancelSoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - return obj; - }, - - fromPartial( - object: DeepPartial - ): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/client.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/client.ts deleted file mode 100644 index b34686d3..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/client.ts +++ /dev/null @@ -1,814 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; - -export const protobufPackage = "ibc.core.client.v1"; - -/** - * IdentifiedClientState defines a client state with an additional client - * identifier field. - */ -export interface IdentifiedClientState { - /** client identifier */ - client_id: string; - /** client state */ - client_state: Any | undefined; -} - -/** - * ConsensusStateWithHeight defines a consensus state with an additional height - * field. - */ -export interface ConsensusStateWithHeight { - /** consensus state height */ - height: Height | undefined; - /** consensus state */ - consensus_state: Any | undefined; -} - -/** - * ClientConsensusStates defines all the stored consensus states for a given - * client. - */ -export interface ClientConsensusStates { - /** client identifier */ - client_id: string; - /** consensus states and their heights associated with the client */ - consensus_states: ConsensusStateWithHeight[]; -} - -/** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute - * client's latest consensus state is copied over to the subject client. The proposal - * handler may fail if the subject and the substitute do not match in client and - * chain parameters (with exception to latest height, frozen height, and chain-id). - */ -export interface ClientUpdateProposal { - /** the title of the update proposal */ - title: string; - /** the description of the proposal */ - description: string; - /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id: string; - /** - * the substitute client identifier for the client standing in for the subject - * client - */ - substitute_client_id: string; -} - -/** - * UpgradeProposal is a gov Content type for initiating an IBC breaking - * upgrade. - */ -export interface UpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; - /** - * An UpgradedClientState must be provided to perform an IBC breaking upgrade. - * This will make the chain commit to the correct upgraded (self) client state - * before the upgrade occurs, so that connecting chains can verify that the - * new upgraded client is valid by verifying a proof on the previous version - * of the chain. This will allow IBC connections to persist smoothly across - * planned chain upgrades - */ - upgraded_client_state: Any | undefined; -} - -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface Height { - /** the revision that the client is currently on */ - revision_number: number; - /** the height within the given revision */ - revision_height: number; -} - -/** Params defines the set of IBC light client parameters. */ -export interface Params { - /** allowed_clients defines the list of allowed client state types. */ - allowed_clients: string[]; -} - -const baseIdentifiedClientState: object = { client_id: "" }; - -export const IdentifiedClientState = { - encode( - message: IdentifiedClientState, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IdentifiedClientState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, - - toJSON(message: IdentifiedClientState): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, -}; - -const baseConsensusStateWithHeight: object = {}; - -export const ConsensusStateWithHeight = { - encode( - message: ConsensusStateWithHeight, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(10).fork()).ldelim(); - } - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ConsensusStateWithHeight { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = Height.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, - - toJSON(message: ConsensusStateWithHeight): unknown { - const obj: any = {}; - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, -}; - -const baseClientConsensusStates: object = { client_id: "" }; - -export const ClientConsensusStates = { - encode( - message: ClientConsensusStates, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - for (const v of message.consensus_states) { - ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientConsensusStates { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.consensus_states.push( - ConsensusStateWithHeight.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ClientConsensusStates): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - if (message.consensus_states) { - obj.consensus_states = message.consensus_states.map((e) => - e ? ConsensusStateWithHeight.toJSON(e) : undefined - ); - } else { - obj.consensus_states = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromPartial(e)); - } - } - return message; - }, -}; - -const baseClientUpdateProposal: object = { - title: "", - description: "", - subject_client_id: "", - substitute_client_id: "", -}; - -export const ClientUpdateProposal = { - encode( - message: ClientUpdateProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.subject_client_id !== "") { - writer.uint32(26).string(message.subject_client_id); - } - if (message.substitute_client_id !== "") { - writer.uint32(34).string(message.substitute_client_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientUpdateProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.subject_client_id = reader.string(); - break; - case 4: - message.substitute_client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = String(object.subject_client_id); - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = String(object.substitute_client_id); - } else { - message.substitute_client_id = ""; - } - return message; - }, - - toJSON(message: ClientUpdateProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.subject_client_id !== undefined && - (obj.subject_client_id = message.subject_client_id); - message.substitute_client_id !== undefined && - (obj.substitute_client_id = message.substitute_client_id); - return obj; - }, - - fromPartial(object: DeepPartial): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = object.subject_client_id; - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = object.substitute_client_id; - } else { - message.substitute_client_id = ""; - } - return message; - }, -}; - -const baseUpgradeProposal: object = { title: "", description: "" }; - -export const UpgradeProposal = { - encode(message: UpgradeProposal, writer: Writer = Writer.create()): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - if (message.upgraded_client_state !== undefined) { - Any.encode( - message.upgraded_client_state, - writer.uint32(34).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUpgradeProposal } as UpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgraded_client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromJSON( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, - - toJSON(message: UpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - message.upgraded_client_state !== undefined && - (obj.upgraded_client_state = message.upgraded_client_state - ? Any.toJSON(message.upgraded_client_state) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromPartial( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, -}; - -const baseHeight: object = { revision_number: 0, revision_height: 0 }; - -export const Height = { - encode(message: Height, writer: Writer = Writer.create()): Writer { - if (message.revision_number !== 0) { - writer.uint32(8).uint64(message.revision_number); - } - if (message.revision_height !== 0) { - writer.uint32(16).uint64(message.revision_height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Height { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeight } as Height; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revision_number = longToNumber(reader.uint64() as Long); - break; - case 2: - message.revision_height = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = Number(object.revision_number); - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = Number(object.revision_height); - } else { - message.revision_height = 0; - } - return message; - }, - - toJSON(message: Height): unknown { - const obj: any = {}; - message.revision_number !== undefined && - (obj.revision_number = message.revision_number); - message.revision_height !== undefined && - (obj.revision_height = message.revision_height); - return obj; - }, - - fromPartial(object: DeepPartial): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = object.revision_number; - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = object.revision_height; - } else { - message.revision_height = 0; - } - return message; - }, -}; - -const baseParams: object = { allowed_clients: "" }; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - for (const v of message.allowed_clients) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - message.allowed_clients = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowed_clients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(String(e)); - } - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - if (message.allowed_clients) { - obj.allowed_clients = message.allowed_clients.map((e) => e); - } else { - obj.allowed_clients = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(e); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/genesis.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/genesis.ts deleted file mode 100644 index e4fe2ae0..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/genesis.ts +++ /dev/null @@ -1,481 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - IdentifiedClientState, - ClientConsensusStates, - Params, -} from "../../../../ibc/core/client/v1/client"; - -export const protobufPackage = "ibc.core.client.v1"; - -/** GenesisState defines the ibc client submodule's genesis state. */ -export interface GenesisState { - /** client states with their corresponding identifiers */ - clients: IdentifiedClientState[]; - /** consensus states from each client */ - clients_consensus: ClientConsensusStates[]; - /** metadata from each client */ - clients_metadata: IdentifiedGenesisMetadata[]; - params: Params | undefined; - /** create localhost on initialization */ - create_localhost: boolean; - /** the sequence for the next generated client identifier */ - next_client_sequence: number; -} - -/** - * GenesisMetadata defines the genesis type for metadata that clients may return - * with ExportMetadata - */ -export interface GenesisMetadata { - /** store key of metadata without clientID-prefix */ - key: Uint8Array; - /** metadata value */ - value: Uint8Array; -} - -/** - * IdentifiedGenesisMetadata has the client metadata with the corresponding - * client id. - */ -export interface IdentifiedGenesisMetadata { - client_id: string; - client_metadata: GenesisMetadata[]; -} - -const baseGenesisState: object = { - create_localhost: false, - next_client_sequence: 0, -}; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - for (const v of message.clients) { - IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.clients_consensus) { - ClientConsensusStates.encode(v!, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.clients_metadata) { - IdentifiedGenesisMetadata.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(34).fork()).ldelim(); - } - if (message.create_localhost === true) { - writer.uint32(40).bool(message.create_localhost); - } - if (message.next_client_sequence !== 0) { - writer.uint32(48).uint64(message.next_client_sequence); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.clients = []; - message.clients_consensus = []; - message.clients_metadata = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.clients.push( - IdentifiedClientState.decode(reader, reader.uint32()) - ); - break; - case 2: - message.clients_consensus.push( - ClientConsensusStates.decode(reader, reader.uint32()) - ); - break; - case 3: - message.clients_metadata.push( - IdentifiedGenesisMetadata.decode(reader, reader.uint32()) - ); - break; - case 4: - message.params = Params.decode(reader, reader.uint32()); - break; - case 5: - message.create_localhost = reader.bool(); - break; - case 6: - message.next_client_sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.clients = []; - message.clients_consensus = []; - message.clients_metadata = []; - if (object.clients !== undefined && object.clients !== null) { - for (const e of object.clients) { - message.clients.push(IdentifiedClientState.fromJSON(e)); - } - } - if ( - object.clients_consensus !== undefined && - object.clients_consensus !== null - ) { - for (const e of object.clients_consensus) { - message.clients_consensus.push(ClientConsensusStates.fromJSON(e)); - } - } - if ( - object.clients_metadata !== undefined && - object.clients_metadata !== null - ) { - for (const e of object.clients_metadata) { - message.clients_metadata.push(IdentifiedGenesisMetadata.fromJSON(e)); - } - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if ( - object.create_localhost !== undefined && - object.create_localhost !== null - ) { - message.create_localhost = Boolean(object.create_localhost); - } else { - message.create_localhost = false; - } - if ( - object.next_client_sequence !== undefined && - object.next_client_sequence !== null - ) { - message.next_client_sequence = Number(object.next_client_sequence); - } else { - message.next_client_sequence = 0; - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.clients) { - obj.clients = message.clients.map((e) => - e ? IdentifiedClientState.toJSON(e) : undefined - ); - } else { - obj.clients = []; - } - if (message.clients_consensus) { - obj.clients_consensus = message.clients_consensus.map((e) => - e ? ClientConsensusStates.toJSON(e) : undefined - ); - } else { - obj.clients_consensus = []; - } - if (message.clients_metadata) { - obj.clients_metadata = message.clients_metadata.map((e) => - e ? IdentifiedGenesisMetadata.toJSON(e) : undefined - ); - } else { - obj.clients_metadata = []; - } - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - message.create_localhost !== undefined && - (obj.create_localhost = message.create_localhost); - message.next_client_sequence !== undefined && - (obj.next_client_sequence = message.next_client_sequence); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.clients = []; - message.clients_consensus = []; - message.clients_metadata = []; - if (object.clients !== undefined && object.clients !== null) { - for (const e of object.clients) { - message.clients.push(IdentifiedClientState.fromPartial(e)); - } - } - if ( - object.clients_consensus !== undefined && - object.clients_consensus !== null - ) { - for (const e of object.clients_consensus) { - message.clients_consensus.push(ClientConsensusStates.fromPartial(e)); - } - } - if ( - object.clients_metadata !== undefined && - object.clients_metadata !== null - ) { - for (const e of object.clients_metadata) { - message.clients_metadata.push(IdentifiedGenesisMetadata.fromPartial(e)); - } - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if ( - object.create_localhost !== undefined && - object.create_localhost !== null - ) { - message.create_localhost = object.create_localhost; - } else { - message.create_localhost = false; - } - if ( - object.next_client_sequence !== undefined && - object.next_client_sequence !== null - ) { - message.next_client_sequence = object.next_client_sequence; - } else { - message.next_client_sequence = 0; - } - return message; - }, -}; - -const baseGenesisMetadata: object = {}; - -export const GenesisMetadata = { - encode(message: GenesisMetadata, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisMetadata { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisMetadata } as GenesisMetadata; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisMetadata { - const message = { ...baseGenesisMetadata } as GenesisMetadata; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: GenesisMetadata): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisMetadata { - const message = { ...baseGenesisMetadata } as GenesisMetadata; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -const baseIdentifiedGenesisMetadata: object = { client_id: "" }; - -export const IdentifiedGenesisMetadata = { - encode( - message: IdentifiedGenesisMetadata, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - for (const v of message.client_metadata) { - GenesisMetadata.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): IdentifiedGenesisMetadata { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseIdentifiedGenesisMetadata, - } as IdentifiedGenesisMetadata; - message.client_metadata = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_metadata.push( - GenesisMetadata.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IdentifiedGenesisMetadata { - const message = { - ...baseIdentifiedGenesisMetadata, - } as IdentifiedGenesisMetadata; - message.client_metadata = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if ( - object.client_metadata !== undefined && - object.client_metadata !== null - ) { - for (const e of object.client_metadata) { - message.client_metadata.push(GenesisMetadata.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: IdentifiedGenesisMetadata): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - if (message.client_metadata) { - obj.client_metadata = message.client_metadata.map((e) => - e ? GenesisMetadata.toJSON(e) : undefined - ); - } else { - obj.client_metadata = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): IdentifiedGenesisMetadata { - const message = { - ...baseIdentifiedGenesisMetadata, - } as IdentifiedGenesisMetadata; - message.client_metadata = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if ( - object.client_metadata !== undefined && - object.client_metadata !== null - ) { - for (const e of object.client_metadata) { - message.client_metadata.push(GenesisMetadata.fromPartial(e)); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/query.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/query.ts deleted file mode 100644 index 206939e4..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/query.ts +++ /dev/null @@ -1,1741 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { Any } from "../../../../google/protobuf/any"; -import { - Height, - IdentifiedClientState, - ConsensusStateWithHeight, - Params, -} from "../../../../ibc/core/client/v1/client"; -import { - PageRequest, - PageResponse, -} from "../../../../cosmos/base/query/v1beta1/pagination"; - -export const protobufPackage = "ibc.core.client.v1"; - -/** - * QueryClientStateRequest is the request type for the Query/ClientState RPC - * method - */ -export interface QueryClientStateRequest { - /** client state unique identifier */ - client_id: string; -} - -/** - * QueryClientStateResponse is the response type for the Query/ClientState RPC - * method. Besides the client state, it includes a proof and the height from - * which the proof was retrieved. - */ -export interface QueryClientStateResponse { - /** client state associated with the request identifier */ - client_state: Any | undefined; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** - * QueryClientStatesRequest is the request type for the Query/ClientStates RPC - * method - */ -export interface QueryClientStatesRequest { - /** pagination request */ - pagination: PageRequest | undefined; -} - -/** - * QueryClientStatesResponse is the response type for the Query/ClientStates RPC - * method. - */ -export interface QueryClientStatesResponse { - /** list of stored ClientStates of the chain. */ - client_states: IdentifiedClientState[]; - /** pagination response */ - pagination: PageResponse | undefined; -} - -/** - * QueryConsensusStateRequest is the request type for the Query/ConsensusState - * RPC method. Besides the consensus state, it includes a proof and the height - * from which the proof was retrieved. - */ -export interface QueryConsensusStateRequest { - /** client identifier */ - client_id: string; - /** consensus state revision number */ - revision_number: number; - /** consensus state revision height */ - revision_height: number; - /** - * latest_height overrrides the height field and queries the latest stored - * ConsensusState - */ - latest_height: boolean; -} - -/** - * QueryConsensusStateResponse is the response type for the Query/ConsensusState - * RPC method - */ -export interface QueryConsensusStateResponse { - /** consensus state associated with the client identifier at the given height */ - consensus_state: Any | undefined; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** - * QueryConsensusStatesRequest is the request type for the Query/ConsensusStates - * RPC method. - */ -export interface QueryConsensusStatesRequest { - /** client identifier */ - client_id: string; - /** pagination request */ - pagination: PageRequest | undefined; -} - -/** - * QueryConsensusStatesResponse is the response type for the - * Query/ConsensusStates RPC method - */ -export interface QueryConsensusStatesResponse { - /** consensus states associated with the identifier */ - consensus_states: ConsensusStateWithHeight[]; - /** pagination response */ - pagination: PageResponse | undefined; -} - -/** - * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC - * method - */ -export interface QueryClientStatusRequest { - /** client unique identifier */ - client_id: string; -} - -/** - * QueryClientStatusResponse is the response type for the Query/ClientStatus RPC - * method. It returns the current status of the IBC client. - */ -export interface QueryClientStatusResponse { - status: string; -} - -/** - * QueryClientParamsRequest is the request type for the Query/ClientParams RPC - * method. - */ -export interface QueryClientParamsRequest {} - -/** - * QueryClientParamsResponse is the response type for the Query/ClientParams RPC - * method. - */ -export interface QueryClientParamsResponse { - /** params defines the parameters of the module. */ - params: Params | undefined; -} - -/** - * QueryUpgradedClientStateRequest is the request type for the - * Query/UpgradedClientState RPC method - */ -export interface QueryUpgradedClientStateRequest {} - -/** - * QueryUpgradedClientStateResponse is the response type for the - * Query/UpgradedClientState RPC method. - */ -export interface QueryUpgradedClientStateResponse { - /** client state associated with the request identifier */ - upgraded_client_state: Any | undefined; -} - -/** - * QueryUpgradedConsensusStateRequest is the request type for the - * Query/UpgradedConsensusState RPC method - */ -export interface QueryUpgradedConsensusStateRequest {} - -/** - * QueryUpgradedConsensusStateResponse is the response type for the - * Query/UpgradedConsensusState RPC method. - */ -export interface QueryUpgradedConsensusStateResponse { - /** Consensus state associated with the request identifier */ - upgraded_consensus_state: Any | undefined; -} - -const baseQueryClientStateRequest: object = { client_id: "" }; - -export const QueryClientStateRequest = { - encode( - message: QueryClientStateRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryClientStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientStateRequest, - } as QueryClientStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryClientStateRequest { - const message = { - ...baseQueryClientStateRequest, - } as QueryClientStateRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - return message; - }, - - toJSON(message: QueryClientStateRequest): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryClientStateRequest { - const message = { - ...baseQueryClientStateRequest, - } as QueryClientStateRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - return message; - }, -}; - -const baseQueryClientStateResponse: object = {}; - -export const QueryClientStateResponse = { - encode( - message: QueryClientStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(10).fork()).ldelim(); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryClientStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientStateResponse, - } as QueryClientStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_state = Any.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryClientStateResponse { - const message = { - ...baseQueryClientStateResponse, - } as QueryClientStateResponse; - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryClientStateResponse): unknown { - const obj: any = {}; - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryClientStateResponse { - const message = { - ...baseQueryClientStateResponse, - } as QueryClientStateResponse; - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryClientStatesRequest: object = {}; - -export const QueryClientStatesRequest = { - encode( - message: QueryClientStatesRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryClientStatesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientStatesRequest, - } as QueryClientStatesRequest; - 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): QueryClientStatesRequest { - const message = { - ...baseQueryClientStatesRequest, - } as QueryClientStatesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryClientStatesRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryClientStatesRequest { - const message = { - ...baseQueryClientStatesRequest, - } as QueryClientStatesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryClientStatesResponse: object = {}; - -export const QueryClientStatesResponse = { - encode( - message: QueryClientStatesResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.client_states) { - IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryClientStatesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientStatesResponse, - } as QueryClientStatesResponse; - message.client_states = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_states.push( - IdentifiedClientState.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): QueryClientStatesResponse { - const message = { - ...baseQueryClientStatesResponse, - } as QueryClientStatesResponse; - message.client_states = []; - if (object.client_states !== undefined && object.client_states !== null) { - for (const e of object.client_states) { - message.client_states.push(IdentifiedClientState.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryClientStatesResponse): unknown { - const obj: any = {}; - if (message.client_states) { - obj.client_states = message.client_states.map((e) => - e ? IdentifiedClientState.toJSON(e) : undefined - ); - } else { - obj.client_states = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryClientStatesResponse { - const message = { - ...baseQueryClientStatesResponse, - } as QueryClientStatesResponse; - message.client_states = []; - if (object.client_states !== undefined && object.client_states !== null) { - for (const e of object.client_states) { - message.client_states.push(IdentifiedClientState.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryConsensusStateRequest: object = { - client_id: "", - revision_number: 0, - revision_height: 0, - latest_height: false, -}; - -export const QueryConsensusStateRequest = { - encode( - message: QueryConsensusStateRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.revision_number !== 0) { - writer.uint32(16).uint64(message.revision_number); - } - if (message.revision_height !== 0) { - writer.uint32(24).uint64(message.revision_height); - } - if (message.latest_height === true) { - writer.uint32(32).bool(message.latest_height); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConsensusStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConsensusStateRequest, - } as QueryConsensusStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.revision_number = longToNumber(reader.uint64() as Long); - break; - case 3: - message.revision_height = longToNumber(reader.uint64() as Long); - break; - case 4: - message.latest_height = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConsensusStateRequest { - const message = { - ...baseQueryConsensusStateRequest, - } as QueryConsensusStateRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = Number(object.revision_number); - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = Number(object.revision_height); - } else { - message.revision_height = 0; - } - if (object.latest_height !== undefined && object.latest_height !== null) { - message.latest_height = Boolean(object.latest_height); - } else { - message.latest_height = false; - } - return message; - }, - - toJSON(message: QueryConsensusStateRequest): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.revision_number !== undefined && - (obj.revision_number = message.revision_number); - message.revision_height !== undefined && - (obj.revision_height = message.revision_height); - message.latest_height !== undefined && - (obj.latest_height = message.latest_height); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConsensusStateRequest { - const message = { - ...baseQueryConsensusStateRequest, - } as QueryConsensusStateRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = object.revision_number; - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = object.revision_height; - } else { - message.revision_height = 0; - } - if (object.latest_height !== undefined && object.latest_height !== null) { - message.latest_height = object.latest_height; - } else { - message.latest_height = false; - } - return message; - }, -}; - -const baseQueryConsensusStateResponse: object = {}; - -export const QueryConsensusStateResponse = { - encode( - message: QueryConsensusStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(10).fork()).ldelim(); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConsensusStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConsensusStateResponse, - } as QueryConsensusStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConsensusStateResponse { - const message = { - ...baseQueryConsensusStateResponse, - } as QueryConsensusStateResponse; - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryConsensusStateResponse): unknown { - const obj: any = {}; - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConsensusStateResponse { - const message = { - ...baseQueryConsensusStateResponse, - } as QueryConsensusStateResponse; - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryConsensusStatesRequest: object = { client_id: "" }; - -export const QueryConsensusStatesRequest = { - encode( - message: QueryConsensusStatesRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConsensusStatesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConsensusStatesRequest, - } as QueryConsensusStatesRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConsensusStatesRequest { - const message = { - ...baseQueryConsensusStatesRequest, - } as QueryConsensusStatesRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryConsensusStatesRequest): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConsensusStatesRequest { - const message = { - ...baseQueryConsensusStatesRequest, - } as QueryConsensusStatesRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryConsensusStatesResponse: object = {}; - -export const QueryConsensusStatesResponse = { - encode( - message: QueryConsensusStatesResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.consensus_states) { - ConsensusStateWithHeight.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConsensusStatesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConsensusStatesResponse, - } as QueryConsensusStatesResponse; - message.consensus_states = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_states.push( - ConsensusStateWithHeight.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): QueryConsensusStatesResponse { - const message = { - ...baseQueryConsensusStatesResponse, - } as QueryConsensusStatesResponse; - message.consensus_states = []; - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryConsensusStatesResponse): unknown { - const obj: any = {}; - if (message.consensus_states) { - obj.consensus_states = message.consensus_states.map((e) => - e ? ConsensusStateWithHeight.toJSON(e) : undefined - ); - } else { - obj.consensus_states = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConsensusStatesResponse { - const message = { - ...baseQueryConsensusStatesResponse, - } as QueryConsensusStatesResponse; - message.consensus_states = []; - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryClientStatusRequest: object = { client_id: "" }; - -export const QueryClientStatusRequest = { - encode( - message: QueryClientStatusRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryClientStatusRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientStatusRequest, - } as QueryClientStatusRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryClientStatusRequest { - const message = { - ...baseQueryClientStatusRequest, - } as QueryClientStatusRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - return message; - }, - - toJSON(message: QueryClientStatusRequest): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryClientStatusRequest { - const message = { - ...baseQueryClientStatusRequest, - } as QueryClientStatusRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - return message; - }, -}; - -const baseQueryClientStatusResponse: object = { status: "" }; - -export const QueryClientStatusResponse = { - encode( - message: QueryClientStatusResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.status !== "") { - writer.uint32(10).string(message.status); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryClientStatusResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientStatusResponse, - } as QueryClientStatusResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.status = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryClientStatusResponse { - const message = { - ...baseQueryClientStatusResponse, - } as QueryClientStatusResponse; - if (object.status !== undefined && object.status !== null) { - message.status = String(object.status); - } else { - message.status = ""; - } - return message; - }, - - toJSON(message: QueryClientStatusResponse): unknown { - const obj: any = {}; - message.status !== undefined && (obj.status = message.status); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryClientStatusResponse { - const message = { - ...baseQueryClientStatusResponse, - } as QueryClientStatusResponse; - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } else { - message.status = ""; - } - return message; - }, -}; - -const baseQueryClientParamsRequest: object = {}; - -export const QueryClientParamsRequest = { - encode( - _: QueryClientParamsRequest, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryClientParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientParamsRequest, - } as QueryClientParamsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryClientParamsRequest { - const message = { - ...baseQueryClientParamsRequest, - } as QueryClientParamsRequest; - return message; - }, - - toJSON(_: QueryClientParamsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): QueryClientParamsRequest { - const message = { - ...baseQueryClientParamsRequest, - } as QueryClientParamsRequest; - return message; - }, -}; - -const baseQueryClientParamsResponse: object = {}; - -export const QueryClientParamsResponse = { - encode( - message: QueryClientParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryClientParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientParamsResponse, - } as QueryClientParamsResponse; - 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): QueryClientParamsResponse { - const message = { - ...baseQueryClientParamsResponse, - } as QueryClientParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: QueryClientParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryClientParamsResponse { - const message = { - ...baseQueryClientParamsResponse, - } as QueryClientParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -const baseQueryUpgradedClientStateRequest: object = {}; - -export const QueryUpgradedClientStateRequest = { - encode( - _: QueryUpgradedClientStateRequest, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUpgradedClientStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUpgradedClientStateRequest, - } as QueryUpgradedClientStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryUpgradedClientStateRequest { - const message = { - ...baseQueryUpgradedClientStateRequest, - } as QueryUpgradedClientStateRequest; - return message; - }, - - toJSON(_: QueryUpgradedClientStateRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): QueryUpgradedClientStateRequest { - const message = { - ...baseQueryUpgradedClientStateRequest, - } as QueryUpgradedClientStateRequest; - return message; - }, -}; - -const baseQueryUpgradedClientStateResponse: object = {}; - -export const QueryUpgradedClientStateResponse = { - encode( - message: QueryUpgradedClientStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.upgraded_client_state !== undefined) { - Any.encode( - message.upgraded_client_state, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUpgradedClientStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUpgradedClientStateResponse, - } as QueryUpgradedClientStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.upgraded_client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUpgradedClientStateResponse { - const message = { - ...baseQueryUpgradedClientStateResponse, - } as QueryUpgradedClientStateResponse; - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromJSON( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, - - toJSON(message: QueryUpgradedClientStateResponse): unknown { - const obj: any = {}; - message.upgraded_client_state !== undefined && - (obj.upgraded_client_state = message.upgraded_client_state - ? Any.toJSON(message.upgraded_client_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUpgradedClientStateResponse { - const message = { - ...baseQueryUpgradedClientStateResponse, - } as QueryUpgradedClientStateResponse; - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromPartial( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, -}; - -const baseQueryUpgradedConsensusStateRequest: object = {}; - -export const QueryUpgradedConsensusStateRequest = { - encode( - _: QueryUpgradedConsensusStateRequest, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUpgradedConsensusStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUpgradedConsensusStateRequest, - } as QueryUpgradedConsensusStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryUpgradedConsensusStateRequest { - const message = { - ...baseQueryUpgradedConsensusStateRequest, - } as QueryUpgradedConsensusStateRequest; - return message; - }, - - toJSON(_: QueryUpgradedConsensusStateRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): QueryUpgradedConsensusStateRequest { - const message = { - ...baseQueryUpgradedConsensusStateRequest, - } as QueryUpgradedConsensusStateRequest; - return message; - }, -}; - -const baseQueryUpgradedConsensusStateResponse: object = {}; - -export const QueryUpgradedConsensusStateResponse = { - encode( - message: QueryUpgradedConsensusStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.upgraded_consensus_state !== undefined) { - Any.encode( - message.upgraded_consensus_state, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUpgradedConsensusStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUpgradedConsensusStateResponse, - } as QueryUpgradedConsensusStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.upgraded_consensus_state = Any.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryUpgradedConsensusStateResponse { - const message = { - ...baseQueryUpgradedConsensusStateResponse, - } as QueryUpgradedConsensusStateResponse; - if ( - object.upgraded_consensus_state !== undefined && - object.upgraded_consensus_state !== null - ) { - message.upgraded_consensus_state = Any.fromJSON( - object.upgraded_consensus_state - ); - } else { - message.upgraded_consensus_state = undefined; - } - return message; - }, - - toJSON(message: QueryUpgradedConsensusStateResponse): unknown { - const obj: any = {}; - message.upgraded_consensus_state !== undefined && - (obj.upgraded_consensus_state = message.upgraded_consensus_state - ? Any.toJSON(message.upgraded_consensus_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryUpgradedConsensusStateResponse { - const message = { - ...baseQueryUpgradedConsensusStateResponse, - } as QueryUpgradedConsensusStateResponse; - if ( - object.upgraded_consensus_state !== undefined && - object.upgraded_consensus_state !== null - ) { - message.upgraded_consensus_state = Any.fromPartial( - object.upgraded_consensus_state - ); - } else { - message.upgraded_consensus_state = undefined; - } - return message; - }, -}; - -/** Query provides defines the gRPC querier service */ -export interface Query { - /** ClientState queries an IBC light client. */ - ClientState( - request: QueryClientStateRequest - ): Promise; - /** ClientStates queries all the IBC light clients of a chain. */ - ClientStates( - request: QueryClientStatesRequest - ): Promise; - /** - * ConsensusState queries a consensus state associated with a client state at - * a given height. - */ - ConsensusState( - request: QueryConsensusStateRequest - ): Promise; - /** - * ConsensusStates queries all the consensus state associated with a given - * client. - */ - ConsensusStates( - request: QueryConsensusStatesRequest - ): Promise; - /** Status queries the status of an IBC client. */ - ClientStatus( - request: QueryClientStatusRequest - ): Promise; - /** ClientParams queries all parameters of the ibc client. */ - ClientParams( - request: QueryClientParamsRequest - ): Promise; - /** UpgradedClientState queries an Upgraded IBC light client. */ - UpgradedClientState( - request: QueryUpgradedClientStateRequest - ): Promise; - /** UpgradedConsensusState queries an Upgraded IBC consensus state. */ - UpgradedConsensusState( - request: QueryUpgradedConsensusStateRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - ClientState( - request: QueryClientStateRequest - ): Promise { - const data = QueryClientStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Query", - "ClientState", - data - ); - return promise.then((data) => - QueryClientStateResponse.decode(new Reader(data)) - ); - } - - ClientStates( - request: QueryClientStatesRequest - ): Promise { - const data = QueryClientStatesRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Query", - "ClientStates", - data - ); - return promise.then((data) => - QueryClientStatesResponse.decode(new Reader(data)) - ); - } - - ConsensusState( - request: QueryConsensusStateRequest - ): Promise { - const data = QueryConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Query", - "ConsensusState", - data - ); - return promise.then((data) => - QueryConsensusStateResponse.decode(new Reader(data)) - ); - } - - ConsensusStates( - request: QueryConsensusStatesRequest - ): Promise { - const data = QueryConsensusStatesRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Query", - "ConsensusStates", - data - ); - return promise.then((data) => - QueryConsensusStatesResponse.decode(new Reader(data)) - ); - } - - ClientStatus( - request: QueryClientStatusRequest - ): Promise { - const data = QueryClientStatusRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Query", - "ClientStatus", - data - ); - return promise.then((data) => - QueryClientStatusResponse.decode(new Reader(data)) - ); - } - - ClientParams( - request: QueryClientParamsRequest - ): Promise { - const data = QueryClientParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Query", - "ClientParams", - data - ); - return promise.then((data) => - QueryClientParamsResponse.decode(new Reader(data)) - ); - } - - UpgradedClientState( - request: QueryUpgradedClientStateRequest - ): Promise { - const data = QueryUpgradedClientStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Query", - "UpgradedClientState", - data - ); - return promise.then((data) => - QueryUpgradedClientStateResponse.decode(new Reader(data)) - ); - } - - UpgradedConsensusState( - request: QueryUpgradedConsensusStateRequest - ): Promise { - const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Query", - "UpgradedConsensusState", - data - ); - return promise.then((data) => - QueryUpgradedConsensusStateResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/tx.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/tx.ts deleted file mode 100644 index cae5b453..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/module/types/ibc/core/client/v1/tx.ts +++ /dev/null @@ -1,862 +0,0 @@ -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; - -export const protobufPackage = "ibc.core.client.v1"; - -/** MsgCreateClient defines a message to create an IBC client */ -export interface MsgCreateClient { - /** light client state */ - client_state: Any | undefined; - /** - * consensus state associated with the client that corresponds to a given - * height. - */ - consensus_state: Any | undefined; - /** signer address */ - signer: string; -} - -/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ -export interface MsgCreateClientResponse {} - -/** - * MsgUpdateClient defines an sdk.Msg to update a IBC client state using - * the given header. - */ -export interface MsgUpdateClient { - /** client unique identifier */ - client_id: string; - /** header to update the light client */ - header: Any | undefined; - /** signer address */ - signer: string; -} - -/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ -export interface MsgUpdateClientResponse {} - -/** - * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client - * state - */ -export interface MsgUpgradeClient { - /** client unique identifier */ - client_id: string; - /** upgraded client state */ - client_state: Any | undefined; - /** - * upgraded consensus state, only contains enough information to serve as a - * basis of trust in update logic - */ - consensus_state: Any | undefined; - /** proof that old chain committed to new client */ - proof_upgrade_client: Uint8Array; - /** proof that old chain committed to new consensus state */ - proof_upgrade_consensus_state: Uint8Array; - /** signer address */ - signer: string; -} - -/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ -export interface MsgUpgradeClientResponse {} - -/** - * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for - * light client misbehaviour. - */ -export interface MsgSubmitMisbehaviour { - /** client unique identifier */ - client_id: string; - /** misbehaviour used for freezing the light client */ - misbehaviour: Any | undefined; - /** signer address */ - signer: string; -} - -/** - * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response - * type. - */ -export interface MsgSubmitMisbehaviourResponse {} - -const baseMsgCreateClient: object = { signer: "" }; - -export const MsgCreateClient = { - encode(message: MsgCreateClient, writer: Writer = Writer.create()): Writer { - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(10).fork()).ldelim(); - } - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(18).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(26).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgCreateClient { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgCreateClient } as MsgCreateClient; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_state = Any.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateClient { - const message = { ...baseMsgCreateClient } as MsgCreateClient; - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgCreateClient): unknown { - const obj: any = {}; - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgCreateClient { - const message = { ...baseMsgCreateClient } as MsgCreateClient; - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgCreateClientResponse: object = {}; - -export const MsgCreateClientResponse = { - encode(_: MsgCreateClientResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgCreateClientResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgCreateClientResponse, - } as MsgCreateClientResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgCreateClientResponse { - const message = { - ...baseMsgCreateClientResponse, - } as MsgCreateClientResponse; - return message; - }, - - toJSON(_: MsgCreateClientResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgCreateClientResponse { - const message = { - ...baseMsgCreateClientResponse, - } as MsgCreateClientResponse; - return message; - }, -}; - -const baseMsgUpdateClient: object = { client_id: "", signer: "" }; - -export const MsgUpdateClient = { - encode(message: MsgUpdateClient, writer: Writer = Writer.create()): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.header !== undefined) { - Any.encode(message.header, writer.uint32(18).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(26).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgUpdateClient { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUpdateClient } as MsgUpdateClient; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.header = Any.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUpdateClient { - const message = { ...baseMsgUpdateClient } as MsgUpdateClient; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.header !== undefined && object.header !== null) { - message.header = Any.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgUpdateClient): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.header !== undefined && - (obj.header = message.header ? Any.toJSON(message.header) : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgUpdateClient { - const message = { ...baseMsgUpdateClient } as MsgUpdateClient; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.header !== undefined && object.header !== null) { - message.header = Any.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgUpdateClientResponse: object = {}; - -export const MsgUpdateClientResponse = { - encode(_: MsgUpdateClientResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgUpdateClientResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgUpdateClientResponse, - } as MsgUpdateClientResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUpdateClientResponse { - const message = { - ...baseMsgUpdateClientResponse, - } as MsgUpdateClientResponse; - return message; - }, - - toJSON(_: MsgUpdateClientResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgUpdateClientResponse { - const message = { - ...baseMsgUpdateClientResponse, - } as MsgUpdateClientResponse; - return message; - }, -}; - -const baseMsgUpgradeClient: object = { client_id: "", signer: "" }; - -export const MsgUpgradeClient = { - encode(message: MsgUpgradeClient, writer: Writer = Writer.create()): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(18).fork()).ldelim(); - } - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(26).fork()).ldelim(); - } - if (message.proof_upgrade_client.length !== 0) { - writer.uint32(34).bytes(message.proof_upgrade_client); - } - if (message.proof_upgrade_consensus_state.length !== 0) { - writer.uint32(42).bytes(message.proof_upgrade_consensus_state); - } - if (message.signer !== "") { - writer.uint32(50).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgUpgradeClient { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUpgradeClient } as MsgUpgradeClient; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = Any.decode(reader, reader.uint32()); - break; - case 3: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - case 4: - message.proof_upgrade_client = reader.bytes(); - break; - case 5: - message.proof_upgrade_consensus_state = reader.bytes(); - break; - case 6: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUpgradeClient { - const message = { ...baseMsgUpgradeClient } as MsgUpgradeClient; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if ( - object.proof_upgrade_client !== undefined && - object.proof_upgrade_client !== null - ) { - message.proof_upgrade_client = bytesFromBase64( - object.proof_upgrade_client - ); - } - if ( - object.proof_upgrade_consensus_state !== undefined && - object.proof_upgrade_consensus_state !== null - ) { - message.proof_upgrade_consensus_state = bytesFromBase64( - object.proof_upgrade_consensus_state - ); - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgUpgradeClient): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - message.proof_upgrade_client !== undefined && - (obj.proof_upgrade_client = base64FromBytes( - message.proof_upgrade_client !== undefined - ? message.proof_upgrade_client - : new Uint8Array() - )); - message.proof_upgrade_consensus_state !== undefined && - (obj.proof_upgrade_consensus_state = base64FromBytes( - message.proof_upgrade_consensus_state !== undefined - ? message.proof_upgrade_consensus_state - : new Uint8Array() - )); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgUpgradeClient { - const message = { ...baseMsgUpgradeClient } as MsgUpgradeClient; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if ( - object.proof_upgrade_client !== undefined && - object.proof_upgrade_client !== null - ) { - message.proof_upgrade_client = object.proof_upgrade_client; - } else { - message.proof_upgrade_client = new Uint8Array(); - } - if ( - object.proof_upgrade_consensus_state !== undefined && - object.proof_upgrade_consensus_state !== null - ) { - message.proof_upgrade_consensus_state = - object.proof_upgrade_consensus_state; - } else { - message.proof_upgrade_consensus_state = new Uint8Array(); - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgUpgradeClientResponse: object = {}; - -export const MsgUpgradeClientResponse = { - encode( - _: MsgUpgradeClientResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgUpgradeClientResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgUpgradeClientResponse, - } as MsgUpgradeClientResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUpgradeClientResponse { - const message = { - ...baseMsgUpgradeClientResponse, - } as MsgUpgradeClientResponse; - return message; - }, - - toJSON(_: MsgUpgradeClientResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgUpgradeClientResponse { - const message = { - ...baseMsgUpgradeClientResponse, - } as MsgUpgradeClientResponse; - return message; - }, -}; - -const baseMsgSubmitMisbehaviour: object = { client_id: "", signer: "" }; - -export const MsgSubmitMisbehaviour = { - encode( - message: MsgSubmitMisbehaviour, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.misbehaviour !== undefined) { - Any.encode(message.misbehaviour, writer.uint32(18).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(26).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgSubmitMisbehaviour { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSubmitMisbehaviour } as MsgSubmitMisbehaviour; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.misbehaviour = Any.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgSubmitMisbehaviour { - const message = { ...baseMsgSubmitMisbehaviour } as MsgSubmitMisbehaviour; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.misbehaviour !== undefined && object.misbehaviour !== null) { - message.misbehaviour = Any.fromJSON(object.misbehaviour); - } else { - message.misbehaviour = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgSubmitMisbehaviour): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.misbehaviour !== undefined && - (obj.misbehaviour = message.misbehaviour - ? Any.toJSON(message.misbehaviour) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgSubmitMisbehaviour { - const message = { ...baseMsgSubmitMisbehaviour } as MsgSubmitMisbehaviour; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.misbehaviour !== undefined && object.misbehaviour !== null) { - message.misbehaviour = Any.fromPartial(object.misbehaviour); - } else { - message.misbehaviour = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgSubmitMisbehaviourResponse: object = {}; - -export const MsgSubmitMisbehaviourResponse = { - encode( - _: MsgSubmitMisbehaviourResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgSubmitMisbehaviourResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgSubmitMisbehaviourResponse, - } as MsgSubmitMisbehaviourResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgSubmitMisbehaviourResponse { - const message = { - ...baseMsgSubmitMisbehaviourResponse, - } as MsgSubmitMisbehaviourResponse; - return message; - }, - - toJSON(_: MsgSubmitMisbehaviourResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgSubmitMisbehaviourResponse { - const message = { - ...baseMsgSubmitMisbehaviourResponse, - } as MsgSubmitMisbehaviourResponse; - return message; - }, -}; - -/** Msg defines the ibc/client Msg service. */ -export interface Msg { - /** CreateClient defines a rpc handler method for MsgCreateClient. */ - CreateClient(request: MsgCreateClient): Promise; - /** UpdateClient defines a rpc handler method for MsgUpdateClient. */ - UpdateClient(request: MsgUpdateClient): Promise; - /** UpgradeClient defines a rpc handler method for MsgUpgradeClient. */ - UpgradeClient(request: MsgUpgradeClient): Promise; - /** SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ - SubmitMisbehaviour( - request: MsgSubmitMisbehaviour - ): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - CreateClient(request: MsgCreateClient): Promise { - const data = MsgCreateClient.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Msg", - "CreateClient", - data - ); - return promise.then((data) => - MsgCreateClientResponse.decode(new Reader(data)) - ); - } - - UpdateClient(request: MsgUpdateClient): Promise { - const data = MsgUpdateClient.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Msg", - "UpdateClient", - data - ); - return promise.then((data) => - MsgUpdateClientResponse.decode(new Reader(data)) - ); - } - - UpgradeClient(request: MsgUpgradeClient): Promise { - const data = MsgUpgradeClient.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Msg", - "UpgradeClient", - data - ); - return promise.then((data) => - MsgUpgradeClientResponse.decode(new Reader(data)) - ); - } - - SubmitMisbehaviour( - request: MsgSubmitMisbehaviour - ): Promise { - const data = MsgSubmitMisbehaviour.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.client.v1.Msg", - "SubmitMisbehaviour", - data - ); - return promise.then((data) => - MsgSubmitMisbehaviourResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/package.json b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/package.json deleted file mode 100644 index ac7b2ec6..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "ibc-core-client-v1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module ibc.core.client.v1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/ibc-go/v2/modules/core/02-client/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/vuex-root b/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.client.v1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/index.ts deleted file mode 100644 index 57db580c..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/index.ts +++ /dev/null @@ -1,273 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - -import { ConnectionEnd } from "./module/types/ibc/core/connection/v1/connection" -import { IdentifiedConnection } from "./module/types/ibc/core/connection/v1/connection" -import { Counterparty } from "./module/types/ibc/core/connection/v1/connection" -import { ClientPaths } from "./module/types/ibc/core/connection/v1/connection" -import { ConnectionPaths } from "./module/types/ibc/core/connection/v1/connection" -import { Version } from "./module/types/ibc/core/connection/v1/connection" -import { Params } from "./module/types/ibc/core/connection/v1/connection" - - -export { ConnectionEnd, IdentifiedConnection, Counterparty, ClientPaths, ConnectionPaths, Version, Params }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - Connection: {}, - Connections: {}, - ClientConnections: {}, - ConnectionClientState: {}, - ConnectionConsensusState: {}, - - _Structure: { - ConnectionEnd: getStructure(ConnectionEnd.fromPartial({})), - IdentifiedConnection: getStructure(IdentifiedConnection.fromPartial({})), - Counterparty: getStructure(Counterparty.fromPartial({})), - ClientPaths: getStructure(ClientPaths.fromPartial({})), - ConnectionPaths: getStructure(ConnectionPaths.fromPartial({})), - Version: getStructure(Version.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getConnection: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Connection[JSON.stringify(params)] ?? {} - }, - getConnections: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Connections[JSON.stringify(params)] ?? {} - }, - getClientConnections: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientConnections[JSON.stringify(params)] ?? {} - }, - getConnectionClientState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConnectionClientState[JSON.stringify(params)] ?? {} - }, - getConnectionConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConnectionConsensusState[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.core.connection.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryConnection({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryConnection( key.connection_id)).data - - - commit('QUERY', { query: 'Connection', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnection', payload: { options: { all }, params: {...key},query }}) - return getters['getConnection']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnection API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConnections({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryConnections(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryConnections({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Connections', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnections', payload: { options: { all }, params: {...key},query }}) - return getters['getConnections']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnections API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClientConnections({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryClientConnections( key.client_id)).data - - - commit('QUERY', { query: 'ClientConnections', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientConnections', payload: { options: { all }, params: {...key},query }}) - return getters['getClientConnections']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientConnections API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConnectionClientState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryConnectionClientState( key.connection_id)).data - - - commit('QUERY', { query: 'ConnectionClientState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnectionClientState', payload: { options: { all }, params: {...key},query }}) - return getters['getConnectionClientState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnectionClientState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConnectionConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryConnectionConsensusState( key.connection_id, key.revision_number, key.revision_height)).data - - - commit('QUERY', { query: 'ConnectionConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnectionConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getConnectionConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnectionConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/rest.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/rest.ts deleted file mode 100644 index add2f90b..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/rest.ts +++ /dev/null @@ -1,922 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** -* ConnectionEnd defines a stateful object on a chain connected to another -separate one. -NOTE: there must only be 2 defined ConnectionEnds to establish -a connection between two chains. -*/ -export interface V1ConnectionEnd { - /** client associated with this connection. */ - client_id?: string; - - /** - * IBC version which can be utilised to determine encodings or protocols for - * channels or packets utilising this connection. - */ - versions?: V1Version[]; - - /** current state of the connection end. */ - state?: V1State; - - /** counterparty chain associated with this connection. */ - counterparty?: V1Counterparty; - - /** - * delay period that must pass before a consensus state can be used for - * packet-verification NOTE: delay period logic is only implemented by some - * clients. - * @format uint64 - */ - delay_period?: string; -} - -/** - * Counterparty defines the counterparty chain associated with a connection end. - */ -export interface V1Counterparty { - /** - * identifies the client on the counterparty chain associated with a given - * connection. - */ - client_id?: string; - - /** - * identifies the connection end on the counterparty chain associated with a - * given connection. - */ - connection_id?: string; - - /** commitment merkle prefix of the counterparty chain. */ - prefix?: V1MerklePrefix; -} - -/** -* Normally the RevisionHeight is incremented at each height while keeping -RevisionNumber the same. However some consensus algorithms may choose to -reset the height in certain conditions e.g. hard forks, state-machine -breaking changes In these cases, the RevisionNumber is incremented so that -height continues to be monitonically increasing even as the RevisionHeight -gets reset -*/ -export interface V1Height { - /** @format uint64 */ - revision_number?: string; - - /** @format uint64 */ - revision_height?: string; -} - -/** -* IdentifiedClientState defines a client state with an additional client -identifier field. -*/ -export interface V1IdentifiedClientState { - client_id?: string; - - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - client_state?: ProtobufAny; -} - -/** -* IdentifiedConnection defines a connection with additional connection -identifier field. -*/ -export interface V1IdentifiedConnection { - /** connection identifier. */ - id?: string; - - /** client associated with this connection. */ - client_id?: string; - versions?: V1Version[]; - - /** current state of the connection end. */ - state?: V1State; - - /** counterparty chain associated with this connection. */ - counterparty?: V1Counterparty; - - /** - * delay period associated with this connection. - * @format uint64 - */ - delay_period?: string; -} - -export interface V1MerklePrefix { - /** @format byte */ - key_prefix?: string; -} - -/** - * MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. - */ -export type V1MsgConnectionOpenAckResponse = object; - -/** -* MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm -response type. -*/ -export type V1MsgConnectionOpenConfirmResponse = object; - -/** -* MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response -type. -*/ -export type V1MsgConnectionOpenInitResponse = object; - -/** - * MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. - */ -export type V1MsgConnectionOpenTryResponse = object; - -export interface V1QueryClientConnectionsResponse { - /** slice of all the connection paths associated with a client. */ - connection_paths?: string[]; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -export interface V1QueryConnectionClientStateResponse { - /** - * IdentifiedClientState defines a client state with an additional client - * identifier field. - */ - identified_client_state?: V1IdentifiedClientState; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -export interface V1QueryConnectionConsensusStateResponse { - /** - * `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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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" - * } - */ - consensus_state?: ProtobufAny; - client_id?: string; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -/** -* QueryConnectionResponse is the response type for the Query/Connection RPC -method. Besides the connection end, it includes a proof and the height from -which the proof was retrieved. -*/ -export interface V1QueryConnectionResponse { - /** - * ConnectionEnd defines a stateful object on a chain connected to another - * separate one. - * NOTE: there must only be 2 defined ConnectionEnds to establish - * a connection between two chains. - */ - connection?: V1ConnectionEnd; - - /** @format byte */ - proof?: string; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - proof_height?: V1Height; -} - -/** -* QueryConnectionsResponse is the response type for the Query/Connections RPC -method. -*/ -export interface V1QueryConnectionsResponse { - /** list of stored connections of the chain. */ - connections?: V1IdentifiedConnection[]; - - /** - * 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; - * } - */ - pagination?: V1Beta1PageResponse; - - /** - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ - height?: V1Height; -} - -/** -* State defines if a connection is in one of the following states: -INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A connection end has just started the opening handshake. - - STATE_TRYOPEN: A connection end has acknowledged the handshake step on the counterparty -chain. - - STATE_OPEN: A connection end has completed the handshake. -*/ -export enum V1State { - STATE_UNINITIALIZED_UNSPECIFIED = "STATE_UNINITIALIZED_UNSPECIFIED", - STATE_INIT = "STATE_INIT", - STATE_TRYOPEN = "STATE_TRYOPEN", - STATE_OPEN = "STATE_OPEN", -} - -/** -* Version defines the versioning scheme used to negotiate the IBC verison in -the connection handshake. -*/ -export interface V1Version { - identifier?: string; - features?: string[]; -} - -/** -* message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } -*/ -export interface V1Beta1PageRequest { - /** - * 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. - * @format byte - */ - key?: string; - - /** - * 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. - * @format uint64 - */ - offset?: string; - - /** - * 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. - * @format uint64 - */ - limit?: string; - - /** - * 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. - */ - count_total?: 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 V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title ibc/core/connection/v1/connection.proto - * @version version not set - */ -export class Api extends HttpClient { - /** - * No description - * - * @tags Query - * @name QueryClientConnections - * @summary ClientConnections queries the connection paths associated with a client -state. - * @request GET:/ibc/core/connection/v1/client_connections/{client_id} - */ - queryClientConnections = (client_id: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/connection/v1/client_connections/${client_id}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryConnections - * @summary Connections queries all the IBC connections of a chain. - * @request GET:/ibc/core/connection/v1/connections - */ - queryConnections = ( - query?: { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/connection/v1/connections`, - method: "GET", - query: query, - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryConnection - * @summary Connection queries an IBC connection end. - * @request GET:/ibc/core/connection/v1/connections/{connection_id} - */ - queryConnection = (connection_id: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/connection/v1/connections/${connection_id}`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryConnectionClientState - * @summary ConnectionClientState queries the client state associated with the -connection. - * @request GET:/ibc/core/connection/v1/connections/{connection_id}/client_state - */ - queryConnectionClientState = (connection_id: string, params: RequestParams = {}) => - this.request({ - path: `/ibc/core/connection/v1/connections/${connection_id}/client_state`, - method: "GET", - format: "json", - ...params, - }); - - /** - * No description - * - * @tags Query - * @name QueryConnectionConsensusState - * @summary ConnectionConsensusState queries the consensus state associated with the -connection. - * @request GET:/ibc/core/connection/v1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height} - */ - queryConnectionConsensusState = ( - connection_id: string, - revision_number: string, - revision_height: string, - params: RequestParams = {}, - ) => - this.request({ - path: `/ibc/core/connection/v1/connections/${connection_id}/consensus_state/revision/${revision_number}/height/${revision_height}`, - method: "GET", - format: "json", - ...params, - }); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 0bc568f4..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,300 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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 { - /** - * 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { offset: 0, limit: 0, count_total: false }; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts deleted file mode 100644 index e9cefea2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts +++ /dev/null @@ -1,414 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.upgrade.v1beta1"; - -/** Plan specifies information about a planned upgrade and when it should occur. */ -export interface Plan { - /** - * Sets the name for the upgrade. This name will be used by the upgraded - * version of the software to apply any special "on-upgrade" commands during - * the first BeginBlock method after the upgrade is applied. It is also used - * to detect whether a software version can handle a given upgrade. If no - * upgrade handler with this name has been set in the software, it will be - * assumed that the software is out-of-date when the upgrade Time or Height is - * reached and the software will exit. - */ - name: string; - /** - * The time after which the upgrade must be performed. - * Leave set to its zero value to use a pre-defined Height instead. - */ - time: Date | undefined; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ - height: number; - /** - * Any application specific upgrade info to be included on-chain - * such as a git commit that validators could automatically upgrade to - */ - info: string; -} - -/** - * SoftwareUpgradeProposal is a gov Content type for initiating a software - * upgrade. - */ -export interface SoftwareUpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; -} - -/** - * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software - * upgrade. - */ -export interface CancelSoftwareUpgradeProposal { - title: string; - description: string; -} - -const basePlan: object = { name: "", height: 0, info: "" }; - -export const Plan = { - encode(message: Plan, writer: Writer = Writer.create()): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePlan } as Plan; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - return message; - }, - - toJSON(message: Plan): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.height !== undefined && (obj.height = message.height); - message.info !== undefined && (obj.info = message.info); - return obj; - }, - - fromPartial(object: DeepPartial): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - return message; - }, -}; - -const baseSoftwareUpgradeProposal: object = { title: "", description: "" }; - -export const SoftwareUpgradeProposal = { - encode( - message: SoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - return message; - }, - - toJSON(message: SoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - return message; - }, -}; - -const baseCancelSoftwareUpgradeProposal: object = { - title: "", - description: "", -}; - -export const CancelSoftwareUpgradeProposal = { - encode( - message: CancelSoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CancelSoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - return message; - }, - - toJSON(message: CancelSoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - return obj; - }, - - fromPartial( - object: DeepPartial - ): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/api/annotations.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/api/annotations.ts deleted file mode 100644 index aace4787..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/api/http.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/api/http.ts deleted file mode 100644 index ccadff68..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/api/http.ts +++ /dev/null @@ -1,706 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 { - /** - * 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. - */ - fully_decode_reserved_expansion: 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 { - /** - * 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. - */ - response_body: 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). - */ - additional_bindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -const baseHttp: object = { fully_decode_reserved_expansion: false }; - -export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttp } as Http; - message.rules = []; - 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.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, - - 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.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); - return obj; - }, - - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } - return message; - }, -}; - -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; - -export const HttpRule = { - encode(message: HttpRule, writer: Writer = Writer.create()): 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.response_body !== "") { - writer.uint32(98).string(message.response_body); - } - for (const v of message.additional_bindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - 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.response_body = reader.string(); - break; - case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; - }, - - 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.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); - } else { - obj.additional_bindings = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCustomHttpPattern: object = { kind: "", path: "" }; - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - 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 { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; - }, - - toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/client/v1/client.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/client/v1/client.ts deleted file mode 100644 index b34686d3..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/client/v1/client.ts +++ /dev/null @@ -1,814 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; - -export const protobufPackage = "ibc.core.client.v1"; - -/** - * IdentifiedClientState defines a client state with an additional client - * identifier field. - */ -export interface IdentifiedClientState { - /** client identifier */ - client_id: string; - /** client state */ - client_state: Any | undefined; -} - -/** - * ConsensusStateWithHeight defines a consensus state with an additional height - * field. - */ -export interface ConsensusStateWithHeight { - /** consensus state height */ - height: Height | undefined; - /** consensus state */ - consensus_state: Any | undefined; -} - -/** - * ClientConsensusStates defines all the stored consensus states for a given - * client. - */ -export interface ClientConsensusStates { - /** client identifier */ - client_id: string; - /** consensus states and their heights associated with the client */ - consensus_states: ConsensusStateWithHeight[]; -} - -/** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute - * client's latest consensus state is copied over to the subject client. The proposal - * handler may fail if the subject and the substitute do not match in client and - * chain parameters (with exception to latest height, frozen height, and chain-id). - */ -export interface ClientUpdateProposal { - /** the title of the update proposal */ - title: string; - /** the description of the proposal */ - description: string; - /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id: string; - /** - * the substitute client identifier for the client standing in for the subject - * client - */ - substitute_client_id: string; -} - -/** - * UpgradeProposal is a gov Content type for initiating an IBC breaking - * upgrade. - */ -export interface UpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; - /** - * An UpgradedClientState must be provided to perform an IBC breaking upgrade. - * This will make the chain commit to the correct upgraded (self) client state - * before the upgrade occurs, so that connecting chains can verify that the - * new upgraded client is valid by verifying a proof on the previous version - * of the chain. This will allow IBC connections to persist smoothly across - * planned chain upgrades - */ - upgraded_client_state: Any | undefined; -} - -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface Height { - /** the revision that the client is currently on */ - revision_number: number; - /** the height within the given revision */ - revision_height: number; -} - -/** Params defines the set of IBC light client parameters. */ -export interface Params { - /** allowed_clients defines the list of allowed client state types. */ - allowed_clients: string[]; -} - -const baseIdentifiedClientState: object = { client_id: "" }; - -export const IdentifiedClientState = { - encode( - message: IdentifiedClientState, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IdentifiedClientState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, - - toJSON(message: IdentifiedClientState): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, -}; - -const baseConsensusStateWithHeight: object = {}; - -export const ConsensusStateWithHeight = { - encode( - message: ConsensusStateWithHeight, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(10).fork()).ldelim(); - } - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ConsensusStateWithHeight { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = Height.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, - - toJSON(message: ConsensusStateWithHeight): unknown { - const obj: any = {}; - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, -}; - -const baseClientConsensusStates: object = { client_id: "" }; - -export const ClientConsensusStates = { - encode( - message: ClientConsensusStates, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - for (const v of message.consensus_states) { - ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientConsensusStates { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.consensus_states.push( - ConsensusStateWithHeight.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ClientConsensusStates): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - if (message.consensus_states) { - obj.consensus_states = message.consensus_states.map((e) => - e ? ConsensusStateWithHeight.toJSON(e) : undefined - ); - } else { - obj.consensus_states = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromPartial(e)); - } - } - return message; - }, -}; - -const baseClientUpdateProposal: object = { - title: "", - description: "", - subject_client_id: "", - substitute_client_id: "", -}; - -export const ClientUpdateProposal = { - encode( - message: ClientUpdateProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.subject_client_id !== "") { - writer.uint32(26).string(message.subject_client_id); - } - if (message.substitute_client_id !== "") { - writer.uint32(34).string(message.substitute_client_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientUpdateProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.subject_client_id = reader.string(); - break; - case 4: - message.substitute_client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = String(object.subject_client_id); - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = String(object.substitute_client_id); - } else { - message.substitute_client_id = ""; - } - return message; - }, - - toJSON(message: ClientUpdateProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.subject_client_id !== undefined && - (obj.subject_client_id = message.subject_client_id); - message.substitute_client_id !== undefined && - (obj.substitute_client_id = message.substitute_client_id); - return obj; - }, - - fromPartial(object: DeepPartial): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = object.subject_client_id; - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = object.substitute_client_id; - } else { - message.substitute_client_id = ""; - } - return message; - }, -}; - -const baseUpgradeProposal: object = { title: "", description: "" }; - -export const UpgradeProposal = { - encode(message: UpgradeProposal, writer: Writer = Writer.create()): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - if (message.upgraded_client_state !== undefined) { - Any.encode( - message.upgraded_client_state, - writer.uint32(34).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUpgradeProposal } as UpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgraded_client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromJSON( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, - - toJSON(message: UpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - message.upgraded_client_state !== undefined && - (obj.upgraded_client_state = message.upgraded_client_state - ? Any.toJSON(message.upgraded_client_state) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromPartial( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, -}; - -const baseHeight: object = { revision_number: 0, revision_height: 0 }; - -export const Height = { - encode(message: Height, writer: Writer = Writer.create()): Writer { - if (message.revision_number !== 0) { - writer.uint32(8).uint64(message.revision_number); - } - if (message.revision_height !== 0) { - writer.uint32(16).uint64(message.revision_height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Height { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeight } as Height; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revision_number = longToNumber(reader.uint64() as Long); - break; - case 2: - message.revision_height = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = Number(object.revision_number); - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = Number(object.revision_height); - } else { - message.revision_height = 0; - } - return message; - }, - - toJSON(message: Height): unknown { - const obj: any = {}; - message.revision_number !== undefined && - (obj.revision_number = message.revision_number); - message.revision_height !== undefined && - (obj.revision_height = message.revision_height); - return obj; - }, - - fromPartial(object: DeepPartial): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = object.revision_number; - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = object.revision_height; - } else { - message.revision_height = 0; - } - return message; - }, -}; - -const baseParams: object = { allowed_clients: "" }; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - for (const v of message.allowed_clients) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - message.allowed_clients = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowed_clients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(String(e)); - } - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - if (message.allowed_clients) { - obj.allowed_clients = message.allowed_clients.map((e) => e); - } else { - obj.allowed_clients = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(e); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/commitment/v1/commitment.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/commitment/v1/commitment.ts deleted file mode 100644 index baa24fc2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/commitment/v1/commitment.ts +++ /dev/null @@ -1,324 +0,0 @@ -/* eslint-disable */ -import { CommitmentProof } from "../../../../proofs"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "ibc.core.commitment.v1"; - -/** - * MerkleRoot defines a merkle root hash. - * In the Cosmos SDK, the AppHash of a block header becomes the root. - */ -export interface MerkleRoot { - hash: Uint8Array; -} - -/** - * MerklePrefix is merkle path prefixed to the key. - * The constructed key from the Path and the key will be append(Path.KeyPath, - * append(Path.KeyPrefix, key...)) - */ -export interface MerklePrefix { - key_prefix: Uint8Array; -} - -/** - * MerklePath is the path used to verify commitment proofs, which can be an - * arbitrary structured object (defined by a commitment type). - * MerklePath is represented from root-to-leaf - */ -export interface MerklePath { - key_path: string[]; -} - -/** - * MerkleProof is a wrapper type over a chain of CommitmentProofs. - * It demonstrates membership or non-membership for an element or set of - * elements, verifiable in conjunction with a known commitment root. Proofs - * should be succinct. - * MerkleProofs are ordered from leaf-to-root - */ -export interface MerkleProof { - proofs: CommitmentProof[]; -} - -const baseMerkleRoot: object = {}; - -export const MerkleRoot = { - encode(message: MerkleRoot, writer: Writer = Writer.create()): Writer { - if (message.hash.length !== 0) { - writer.uint32(10).bytes(message.hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MerkleRoot { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMerkleRoot } as MerkleRoot; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MerkleRoot { - const message = { ...baseMerkleRoot } as MerkleRoot; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; - }, - - toJSON(message: MerkleRoot): unknown { - const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): MerkleRoot { - const message = { ...baseMerkleRoot } as MerkleRoot; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - return message; - }, -}; - -const baseMerklePrefix: object = {}; - -export const MerklePrefix = { - encode(message: MerklePrefix, writer: Writer = Writer.create()): Writer { - if (message.key_prefix.length !== 0) { - writer.uint32(10).bytes(message.key_prefix); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MerklePrefix { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMerklePrefix } as MerklePrefix; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key_prefix = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MerklePrefix { - const message = { ...baseMerklePrefix } as MerklePrefix; - if (object.key_prefix !== undefined && object.key_prefix !== null) { - message.key_prefix = bytesFromBase64(object.key_prefix); - } - return message; - }, - - toJSON(message: MerklePrefix): unknown { - const obj: any = {}; - message.key_prefix !== undefined && - (obj.key_prefix = base64FromBytes( - message.key_prefix !== undefined ? message.key_prefix : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): MerklePrefix { - const message = { ...baseMerklePrefix } as MerklePrefix; - if (object.key_prefix !== undefined && object.key_prefix !== null) { - message.key_prefix = object.key_prefix; - } else { - message.key_prefix = new Uint8Array(); - } - return message; - }, -}; - -const baseMerklePath: object = { key_path: "" }; - -export const MerklePath = { - encode(message: MerklePath, writer: Writer = Writer.create()): Writer { - for (const v of message.key_path) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MerklePath { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMerklePath } as MerklePath; - message.key_path = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key_path.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MerklePath { - const message = { ...baseMerklePath } as MerklePath; - message.key_path = []; - if (object.key_path !== undefined && object.key_path !== null) { - for (const e of object.key_path) { - message.key_path.push(String(e)); - } - } - return message; - }, - - toJSON(message: MerklePath): unknown { - const obj: any = {}; - if (message.key_path) { - obj.key_path = message.key_path.map((e) => e); - } else { - obj.key_path = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MerklePath { - const message = { ...baseMerklePath } as MerklePath; - message.key_path = []; - if (object.key_path !== undefined && object.key_path !== null) { - for (const e of object.key_path) { - message.key_path.push(e); - } - } - return message; - }, -}; - -const baseMerkleProof: object = {}; - -export const MerkleProof = { - encode(message: MerkleProof, writer: Writer = Writer.create()): Writer { - for (const v of message.proofs) { - CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MerkleProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMerkleProof } as MerkleProof; - message.proofs = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proofs.push(CommitmentProof.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MerkleProof { - const message = { ...baseMerkleProof } as MerkleProof; - message.proofs = []; - if (object.proofs !== undefined && object.proofs !== null) { - for (const e of object.proofs) { - message.proofs.push(CommitmentProof.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MerkleProof): unknown { - const obj: any = {}; - if (message.proofs) { - obj.proofs = message.proofs.map((e) => - e ? CommitmentProof.toJSON(e) : undefined - ); - } else { - obj.proofs = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MerkleProof { - const message = { ...baseMerkleProof } as MerkleProof; - message.proofs = []; - if (object.proofs !== undefined && object.proofs !== null) { - for (const e of object.proofs) { - message.proofs.push(CommitmentProof.fromPartial(e)); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/connection.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/connection.ts deleted file mode 100644 index fd47a913..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/connection.ts +++ /dev/null @@ -1,875 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { MerklePrefix } from "../../../../ibc/core/commitment/v1/commitment"; - -export const protobufPackage = "ibc.core.connection.v1"; - -/** - * State defines if a connection is in one of the following states: - * INIT, TRYOPEN, OPEN or UNINITIALIZED. - */ -export enum State { - /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ - STATE_UNINITIALIZED_UNSPECIFIED = 0, - /** STATE_INIT - A connection end has just started the opening handshake. */ - STATE_INIT = 1, - /** - * STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty - * chain. - */ - STATE_TRYOPEN = 2, - /** STATE_OPEN - A connection end has completed the handshake. */ - STATE_OPEN = 3, - UNRECOGNIZED = -1, -} - -export function stateFromJSON(object: any): State { - switch (object) { - case 0: - case "STATE_UNINITIALIZED_UNSPECIFIED": - return State.STATE_UNINITIALIZED_UNSPECIFIED; - case 1: - case "STATE_INIT": - return State.STATE_INIT; - case 2: - case "STATE_TRYOPEN": - return State.STATE_TRYOPEN; - case 3: - case "STATE_OPEN": - return State.STATE_OPEN; - case -1: - case "UNRECOGNIZED": - default: - return State.UNRECOGNIZED; - } -} - -export function stateToJSON(object: State): string { - switch (object) { - case State.STATE_UNINITIALIZED_UNSPECIFIED: - return "STATE_UNINITIALIZED_UNSPECIFIED"; - case State.STATE_INIT: - return "STATE_INIT"; - case State.STATE_TRYOPEN: - return "STATE_TRYOPEN"; - case State.STATE_OPEN: - return "STATE_OPEN"; - default: - return "UNKNOWN"; - } -} - -/** - * ConnectionEnd defines a stateful object on a chain connected to another - * separate one. - * NOTE: there must only be 2 defined ConnectionEnds to establish - * a connection between two chains. - */ -export interface ConnectionEnd { - /** client associated with this connection. */ - client_id: string; - /** - * IBC version which can be utilised to determine encodings or protocols for - * channels or packets utilising this connection. - */ - versions: Version[]; - /** current state of the connection end. */ - state: State; - /** counterparty chain associated with this connection. */ - counterparty: Counterparty | undefined; - /** - * delay period that must pass before a consensus state can be used for - * packet-verification NOTE: delay period logic is only implemented by some - * clients. - */ - delay_period: number; -} - -/** - * IdentifiedConnection defines a connection with additional connection - * identifier field. - */ -export interface IdentifiedConnection { - /** connection identifier. */ - id: string; - /** client associated with this connection. */ - client_id: string; - /** - * IBC version which can be utilised to determine encodings or protocols for - * channels or packets utilising this connection - */ - versions: Version[]; - /** current state of the connection end. */ - state: State; - /** counterparty chain associated with this connection. */ - counterparty: Counterparty | undefined; - /** delay period associated with this connection. */ - delay_period: number; -} - -/** Counterparty defines the counterparty chain associated with a connection end. */ -export interface Counterparty { - /** - * identifies the client on the counterparty chain associated with a given - * connection. - */ - client_id: string; - /** - * identifies the connection end on the counterparty chain associated with a - * given connection. - */ - connection_id: string; - /** commitment merkle prefix of the counterparty chain. */ - prefix: MerklePrefix | undefined; -} - -/** ClientPaths define all the connection paths for a client state. */ -export interface ClientPaths { - /** list of connection paths */ - paths: string[]; -} - -/** ConnectionPaths define all the connection paths for a given client state. */ -export interface ConnectionPaths { - /** client state unique identifier */ - client_id: string; - /** list of connection paths */ - paths: string[]; -} - -/** - * Version defines the versioning scheme used to negotiate the IBC verison in - * the connection handshake. - */ -export interface Version { - /** unique version identifier */ - identifier: string; - /** list of features compatible with the specified identifier */ - features: string[]; -} - -/** Params defines the set of Connection parameters. */ -export interface Params { - /** - * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the - * largest amount of time that the chain might reasonably take to produce the next block under normal operating - * conditions. A safe choice is 3-5x the expected time per block. - */ - max_expected_time_per_block: number; -} - -const baseConnectionEnd: object = { client_id: "", state: 0, delay_period: 0 }; - -export const ConnectionEnd = { - encode(message: ConnectionEnd, writer: Writer = Writer.create()): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - for (const v of message.versions) { - Version.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.state !== 0) { - writer.uint32(24).int32(message.state); - } - if (message.counterparty !== undefined) { - Counterparty.encode( - message.counterparty, - writer.uint32(34).fork() - ).ldelim(); - } - if (message.delay_period !== 0) { - writer.uint32(40).uint64(message.delay_period); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ConnectionEnd { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConnectionEnd } as ConnectionEnd; - message.versions = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.versions.push(Version.decode(reader, reader.uint32())); - break; - case 3: - message.state = reader.int32() as any; - break; - case 4: - message.counterparty = Counterparty.decode(reader, reader.uint32()); - break; - case 5: - message.delay_period = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConnectionEnd { - const message = { ...baseConnectionEnd } as ConnectionEnd; - message.versions = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.versions !== undefined && object.versions !== null) { - for (const e of object.versions) { - message.versions.push(Version.fromJSON(e)); - } - } - if (object.state !== undefined && object.state !== null) { - message.state = stateFromJSON(object.state); - } else { - message.state = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromJSON(object.counterparty); - } else { - message.counterparty = undefined; - } - if (object.delay_period !== undefined && object.delay_period !== null) { - message.delay_period = Number(object.delay_period); - } else { - message.delay_period = 0; - } - return message; - }, - - toJSON(message: ConnectionEnd): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - if (message.versions) { - obj.versions = message.versions.map((e) => - e ? Version.toJSON(e) : undefined - ); - } else { - obj.versions = []; - } - message.state !== undefined && (obj.state = stateToJSON(message.state)); - message.counterparty !== undefined && - (obj.counterparty = message.counterparty - ? Counterparty.toJSON(message.counterparty) - : undefined); - message.delay_period !== undefined && - (obj.delay_period = message.delay_period); - return obj; - }, - - fromPartial(object: DeepPartial): ConnectionEnd { - const message = { ...baseConnectionEnd } as ConnectionEnd; - message.versions = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.versions !== undefined && object.versions !== null) { - for (const e of object.versions) { - message.versions.push(Version.fromPartial(e)); - } - } - if (object.state !== undefined && object.state !== null) { - message.state = object.state; - } else { - message.state = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromPartial(object.counterparty); - } else { - message.counterparty = undefined; - } - if (object.delay_period !== undefined && object.delay_period !== null) { - message.delay_period = object.delay_period; - } else { - message.delay_period = 0; - } - return message; - }, -}; - -const baseIdentifiedConnection: object = { - id: "", - client_id: "", - state: 0, - delay_period: 0, -}; - -export const IdentifiedConnection = { - encode( - message: IdentifiedConnection, - writer: Writer = Writer.create() - ): Writer { - if (message.id !== "") { - writer.uint32(10).string(message.id); - } - if (message.client_id !== "") { - writer.uint32(18).string(message.client_id); - } - for (const v of message.versions) { - Version.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.state !== 0) { - writer.uint32(32).int32(message.state); - } - if (message.counterparty !== undefined) { - Counterparty.encode( - message.counterparty, - writer.uint32(42).fork() - ).ldelim(); - } - if (message.delay_period !== 0) { - writer.uint32(48).uint64(message.delay_period); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IdentifiedConnection { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIdentifiedConnection } as IdentifiedConnection; - message.versions = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.client_id = reader.string(); - break; - case 3: - message.versions.push(Version.decode(reader, reader.uint32())); - break; - case 4: - message.state = reader.int32() as any; - break; - case 5: - message.counterparty = Counterparty.decode(reader, reader.uint32()); - break; - case 6: - message.delay_period = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IdentifiedConnection { - const message = { ...baseIdentifiedConnection } as IdentifiedConnection; - message.versions = []; - if (object.id !== undefined && object.id !== null) { - message.id = String(object.id); - } else { - message.id = ""; - } - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.versions !== undefined && object.versions !== null) { - for (const e of object.versions) { - message.versions.push(Version.fromJSON(e)); - } - } - if (object.state !== undefined && object.state !== null) { - message.state = stateFromJSON(object.state); - } else { - message.state = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromJSON(object.counterparty); - } else { - message.counterparty = undefined; - } - if (object.delay_period !== undefined && object.delay_period !== null) { - message.delay_period = Number(object.delay_period); - } else { - message.delay_period = 0; - } - return message; - }, - - toJSON(message: IdentifiedConnection): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id); - message.client_id !== undefined && (obj.client_id = message.client_id); - if (message.versions) { - obj.versions = message.versions.map((e) => - e ? Version.toJSON(e) : undefined - ); - } else { - obj.versions = []; - } - message.state !== undefined && (obj.state = stateToJSON(message.state)); - message.counterparty !== undefined && - (obj.counterparty = message.counterparty - ? Counterparty.toJSON(message.counterparty) - : undefined); - message.delay_period !== undefined && - (obj.delay_period = message.delay_period); - return obj; - }, - - fromPartial(object: DeepPartial): IdentifiedConnection { - const message = { ...baseIdentifiedConnection } as IdentifiedConnection; - message.versions = []; - if (object.id !== undefined && object.id !== null) { - message.id = object.id; - } else { - message.id = ""; - } - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.versions !== undefined && object.versions !== null) { - for (const e of object.versions) { - message.versions.push(Version.fromPartial(e)); - } - } - if (object.state !== undefined && object.state !== null) { - message.state = object.state; - } else { - message.state = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromPartial(object.counterparty); - } else { - message.counterparty = undefined; - } - if (object.delay_period !== undefined && object.delay_period !== null) { - message.delay_period = object.delay_period; - } else { - message.delay_period = 0; - } - return message; - }, -}; - -const baseCounterparty: object = { client_id: "", connection_id: "" }; - -export const Counterparty = { - encode(message: Counterparty, writer: Writer = Writer.create()): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.connection_id !== "") { - writer.uint32(18).string(message.connection_id); - } - if (message.prefix !== undefined) { - MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Counterparty { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCounterparty } as Counterparty; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.connection_id = reader.string(); - break; - case 3: - message.prefix = MerklePrefix.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Counterparty { - const message = { ...baseCounterparty } as Counterparty; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = String(object.connection_id); - } else { - message.connection_id = ""; - } - if (object.prefix !== undefined && object.prefix !== null) { - message.prefix = MerklePrefix.fromJSON(object.prefix); - } else { - message.prefix = undefined; - } - return message; - }, - - toJSON(message: Counterparty): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.connection_id !== undefined && - (obj.connection_id = message.connection_id); - message.prefix !== undefined && - (obj.prefix = message.prefix - ? MerklePrefix.toJSON(message.prefix) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Counterparty { - const message = { ...baseCounterparty } as Counterparty; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = object.connection_id; - } else { - message.connection_id = ""; - } - if (object.prefix !== undefined && object.prefix !== null) { - message.prefix = MerklePrefix.fromPartial(object.prefix); - } else { - message.prefix = undefined; - } - return message; - }, -}; - -const baseClientPaths: object = { paths: "" }; - -export const ClientPaths = { - encode(message: ClientPaths, writer: Writer = Writer.create()): Writer { - for (const v of message.paths) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientPaths { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientPaths } as ClientPaths; - message.paths = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientPaths { - const message = { ...baseClientPaths } as ClientPaths; - message.paths = []; - if (object.paths !== undefined && object.paths !== null) { - for (const e of object.paths) { - message.paths.push(String(e)); - } - } - return message; - }, - - toJSON(message: ClientPaths): unknown { - const obj: any = {}; - if (message.paths) { - obj.paths = message.paths.map((e) => e); - } else { - obj.paths = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ClientPaths { - const message = { ...baseClientPaths } as ClientPaths; - message.paths = []; - if (object.paths !== undefined && object.paths !== null) { - for (const e of object.paths) { - message.paths.push(e); - } - } - return message; - }, -}; - -const baseConnectionPaths: object = { client_id: "", paths: "" }; - -export const ConnectionPaths = { - encode(message: ConnectionPaths, writer: Writer = Writer.create()): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - for (const v of message.paths) { - writer.uint32(18).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ConnectionPaths { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConnectionPaths } as ConnectionPaths; - message.paths = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConnectionPaths { - const message = { ...baseConnectionPaths } as ConnectionPaths; - message.paths = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.paths !== undefined && object.paths !== null) { - for (const e of object.paths) { - message.paths.push(String(e)); - } - } - return message; - }, - - toJSON(message: ConnectionPaths): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - if (message.paths) { - obj.paths = message.paths.map((e) => e); - } else { - obj.paths = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ConnectionPaths { - const message = { ...baseConnectionPaths } as ConnectionPaths; - message.paths = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.paths !== undefined && object.paths !== null) { - for (const e of object.paths) { - message.paths.push(e); - } - } - return message; - }, -}; - -const baseVersion: object = { identifier: "", features: "" }; - -export const Version = { - encode(message: Version, writer: Writer = Writer.create()): Writer { - if (message.identifier !== "") { - writer.uint32(10).string(message.identifier); - } - for (const v of message.features) { - writer.uint32(18).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Version { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVersion } as Version; - message.features = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identifier = reader.string(); - break; - case 2: - message.features.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Version { - const message = { ...baseVersion } as Version; - message.features = []; - if (object.identifier !== undefined && object.identifier !== null) { - message.identifier = String(object.identifier); - } else { - message.identifier = ""; - } - if (object.features !== undefined && object.features !== null) { - for (const e of object.features) { - message.features.push(String(e)); - } - } - return message; - }, - - toJSON(message: Version): unknown { - const obj: any = {}; - message.identifier !== undefined && (obj.identifier = message.identifier); - if (message.features) { - obj.features = message.features.map((e) => e); - } else { - obj.features = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Version { - const message = { ...baseVersion } as Version; - message.features = []; - if (object.identifier !== undefined && object.identifier !== null) { - message.identifier = object.identifier; - } else { - message.identifier = ""; - } - if (object.features !== undefined && object.features !== null) { - for (const e of object.features) { - message.features.push(e); - } - } - return message; - }, -}; - -const baseParams: object = { max_expected_time_per_block: 0 }; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.max_expected_time_per_block !== 0) { - writer.uint32(8).uint64(message.max_expected_time_per_block); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_expected_time_per_block = longToNumber( - reader.uint64() as Long - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if ( - object.max_expected_time_per_block !== undefined && - object.max_expected_time_per_block !== null - ) { - message.max_expected_time_per_block = Number( - object.max_expected_time_per_block - ); - } else { - message.max_expected_time_per_block = 0; - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.max_expected_time_per_block !== undefined && - (obj.max_expected_time_per_block = message.max_expected_time_per_block); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if ( - object.max_expected_time_per_block !== undefined && - object.max_expected_time_per_block !== null - ) { - message.max_expected_time_per_block = object.max_expected_time_per_block; - } else { - message.max_expected_time_per_block = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/genesis.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/genesis.ts deleted file mode 100644 index 5cb373d7..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/genesis.ts +++ /dev/null @@ -1,198 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - IdentifiedConnection, - ConnectionPaths, - Params, -} from "../../../../ibc/core/connection/v1/connection"; - -export const protobufPackage = "ibc.core.connection.v1"; - -/** GenesisState defines the ibc connection submodule's genesis state. */ -export interface GenesisState { - connections: IdentifiedConnection[]; - client_connection_paths: ConnectionPaths[]; - /** the sequence for the next generated connection identifier */ - next_connection_sequence: number; - params: Params | undefined; -} - -const baseGenesisState: object = { next_connection_sequence: 0 }; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - for (const v of message.connections) { - IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.client_connection_paths) { - ConnectionPaths.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.next_connection_sequence !== 0) { - writer.uint32(24).uint64(message.next_connection_sequence); - } - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.connections = []; - message.client_connection_paths = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connections.push( - IdentifiedConnection.decode(reader, reader.uint32()) - ); - break; - case 2: - message.client_connection_paths.push( - ConnectionPaths.decode(reader, reader.uint32()) - ); - break; - case 3: - message.next_connection_sequence = longToNumber( - reader.uint64() as Long - ); - break; - case 4: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.connections = []; - message.client_connection_paths = []; - if (object.connections !== undefined && object.connections !== null) { - for (const e of object.connections) { - message.connections.push(IdentifiedConnection.fromJSON(e)); - } - } - if ( - object.client_connection_paths !== undefined && - object.client_connection_paths !== null - ) { - for (const e of object.client_connection_paths) { - message.client_connection_paths.push(ConnectionPaths.fromJSON(e)); - } - } - if ( - object.next_connection_sequence !== undefined && - object.next_connection_sequence !== null - ) { - message.next_connection_sequence = Number( - object.next_connection_sequence - ); - } else { - message.next_connection_sequence = 0; - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.connections) { - obj.connections = message.connections.map((e) => - e ? IdentifiedConnection.toJSON(e) : undefined - ); - } else { - obj.connections = []; - } - if (message.client_connection_paths) { - obj.client_connection_paths = message.client_connection_paths.map((e) => - e ? ConnectionPaths.toJSON(e) : undefined - ); - } else { - obj.client_connection_paths = []; - } - message.next_connection_sequence !== undefined && - (obj.next_connection_sequence = message.next_connection_sequence); - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.connections = []; - message.client_connection_paths = []; - if (object.connections !== undefined && object.connections !== null) { - for (const e of object.connections) { - message.connections.push(IdentifiedConnection.fromPartial(e)); - } - } - if ( - object.client_connection_paths !== undefined && - object.client_connection_paths !== null - ) { - for (const e of object.client_connection_paths) { - message.client_connection_paths.push(ConnectionPaths.fromPartial(e)); - } - } - if ( - object.next_connection_sequence !== undefined && - object.next_connection_sequence !== null - ) { - message.next_connection_sequence = object.next_connection_sequence; - } else { - message.next_connection_sequence = 0; - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/query.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/query.ts deleted file mode 100644 index dd6de9c9..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/query.ts +++ /dev/null @@ -1,1304 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - ConnectionEnd, - IdentifiedConnection, -} from "../../../../ibc/core/connection/v1/connection"; -import { - Height, - IdentifiedClientState, -} from "../../../../ibc/core/client/v1/client"; -import { - PageRequest, - PageResponse, -} from "../../../../cosmos/base/query/v1beta1/pagination"; -import { Any } from "../../../../google/protobuf/any"; - -export const protobufPackage = "ibc.core.connection.v1"; - -/** - * QueryConnectionRequest is the request type for the Query/Connection RPC - * method - */ -export interface QueryConnectionRequest { - /** connection unique identifier */ - connection_id: string; -} - -/** - * QueryConnectionResponse is the response type for the Query/Connection RPC - * method. Besides the connection end, it includes a proof and the height from - * which the proof was retrieved. - */ -export interface QueryConnectionResponse { - /** connection associated with the request identifier */ - connection: ConnectionEnd | undefined; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** - * QueryConnectionsRequest is the request type for the Query/Connections RPC - * method - */ -export interface QueryConnectionsRequest { - pagination: PageRequest | undefined; -} - -/** - * QueryConnectionsResponse is the response type for the Query/Connections RPC - * method. - */ -export interface QueryConnectionsResponse { - /** list of stored connections of the chain. */ - connections: IdentifiedConnection[]; - /** pagination response */ - pagination: PageResponse | undefined; - /** query block height */ - height: Height | undefined; -} - -/** - * QueryClientConnectionsRequest is the request type for the - * Query/ClientConnections RPC method - */ -export interface QueryClientConnectionsRequest { - /** client identifier associated with a connection */ - client_id: string; -} - -/** - * QueryClientConnectionsResponse is the response type for the - * Query/ClientConnections RPC method - */ -export interface QueryClientConnectionsResponse { - /** slice of all the connection paths associated with a client. */ - connection_paths: string[]; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was generated */ - proof_height: Height | undefined; -} - -/** - * QueryConnectionClientStateRequest is the request type for the - * Query/ConnectionClientState RPC method - */ -export interface QueryConnectionClientStateRequest { - /** connection identifier */ - connection_id: string; -} - -/** - * QueryConnectionClientStateResponse is the response type for the - * Query/ConnectionClientState RPC method - */ -export interface QueryConnectionClientStateResponse { - /** client state associated with the channel */ - identified_client_state: IdentifiedClientState | undefined; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -/** - * QueryConnectionConsensusStateRequest is the request type for the - * Query/ConnectionConsensusState RPC method - */ -export interface QueryConnectionConsensusStateRequest { - /** connection identifier */ - connection_id: string; - revision_number: number; - revision_height: number; -} - -/** - * QueryConnectionConsensusStateResponse is the response type for the - * Query/ConnectionConsensusState RPC method - */ -export interface QueryConnectionConsensusStateResponse { - /** consensus state associated with the channel */ - consensus_state: Any | undefined; - /** client ID associated with the consensus state */ - client_id: string; - /** merkle proof of existence */ - proof: Uint8Array; - /** height at which the proof was retrieved */ - proof_height: Height | undefined; -} - -const baseQueryConnectionRequest: object = { connection_id: "" }; - -export const QueryConnectionRequest = { - encode( - message: QueryConnectionRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.connection_id !== "") { - writer.uint32(10).string(message.connection_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryConnectionRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConnectionRequest { - const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = String(object.connection_id); - } else { - message.connection_id = ""; - } - return message; - }, - - toJSON(message: QueryConnectionRequest): unknown { - const obj: any = {}; - message.connection_id !== undefined && - (obj.connection_id = message.connection_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionRequest { - const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = object.connection_id; - } else { - message.connection_id = ""; - } - return message; - }, -}; - -const baseQueryConnectionResponse: object = {}; - -export const QueryConnectionResponse = { - encode( - message: QueryConnectionResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.connection !== undefined) { - ConnectionEnd.encode( - message.connection, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryConnectionResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConnectionResponse, - } as QueryConnectionResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection = ConnectionEnd.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConnectionResponse { - const message = { - ...baseQueryConnectionResponse, - } as QueryConnectionResponse; - if (object.connection !== undefined && object.connection !== null) { - message.connection = ConnectionEnd.fromJSON(object.connection); - } else { - message.connection = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryConnectionResponse): unknown { - const obj: any = {}; - message.connection !== undefined && - (obj.connection = message.connection - ? ConnectionEnd.toJSON(message.connection) - : undefined); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionResponse { - const message = { - ...baseQueryConnectionResponse, - } as QueryConnectionResponse; - if (object.connection !== undefined && object.connection !== null) { - message.connection = ConnectionEnd.fromPartial(object.connection); - } else { - message.connection = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryConnectionsRequest: object = {}; - -export const QueryConnectionsRequest = { - encode( - message: QueryConnectionsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryConnectionsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConnectionsRequest, - } as QueryConnectionsRequest; - 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): QueryConnectionsRequest { - const message = { - ...baseQueryConnectionsRequest, - } as QueryConnectionsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryConnectionsRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionsRequest { - const message = { - ...baseQueryConnectionsRequest, - } as QueryConnectionsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryConnectionsResponse: object = {}; - -export const QueryConnectionsResponse = { - encode( - message: QueryConnectionsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.connections) { - IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConnectionsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConnectionsResponse, - } as QueryConnectionsResponse; - message.connections = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connections.push( - IdentifiedConnection.decode(reader, reader.uint32()) - ); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConnectionsResponse { - const message = { - ...baseQueryConnectionsResponse, - } as QueryConnectionsResponse; - message.connections = []; - if (object.connections !== undefined && object.connections !== null) { - for (const e of object.connections) { - message.connections.push(IdentifiedConnection.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - return message; - }, - - toJSON(message: QueryConnectionsResponse): unknown { - const obj: any = {}; - if (message.connections) { - obj.connections = message.connections.map((e) => - e ? IdentifiedConnection.toJSON(e) : undefined - ); - } else { - obj.connections = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionsResponse { - const message = { - ...baseQueryConnectionsResponse, - } as QueryConnectionsResponse; - message.connections = []; - if (object.connections !== undefined && object.connections !== null) { - for (const e of object.connections) { - message.connections.push(IdentifiedConnection.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - return message; - }, -}; - -const baseQueryClientConnectionsRequest: object = { client_id: "" }; - -export const QueryClientConnectionsRequest = { - encode( - message: QueryClientConnectionsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryClientConnectionsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientConnectionsRequest, - } as QueryClientConnectionsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryClientConnectionsRequest { - const message = { - ...baseQueryClientConnectionsRequest, - } as QueryClientConnectionsRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - return message; - }, - - toJSON(message: QueryClientConnectionsRequest): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryClientConnectionsRequest { - const message = { - ...baseQueryClientConnectionsRequest, - } as QueryClientConnectionsRequest; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - return message; - }, -}; - -const baseQueryClientConnectionsResponse: object = { connection_paths: "" }; - -export const QueryClientConnectionsResponse = { - encode( - message: QueryClientConnectionsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.connection_paths) { - writer.uint32(10).string(v!); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryClientConnectionsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryClientConnectionsResponse, - } as QueryClientConnectionsResponse; - message.connection_paths = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_paths.push(reader.string()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryClientConnectionsResponse { - const message = { - ...baseQueryClientConnectionsResponse, - } as QueryClientConnectionsResponse; - message.connection_paths = []; - if ( - object.connection_paths !== undefined && - object.connection_paths !== null - ) { - for (const e of object.connection_paths) { - message.connection_paths.push(String(e)); - } - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryClientConnectionsResponse): unknown { - const obj: any = {}; - if (message.connection_paths) { - obj.connection_paths = message.connection_paths.map((e) => e); - } else { - obj.connection_paths = []; - } - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryClientConnectionsResponse { - const message = { - ...baseQueryClientConnectionsResponse, - } as QueryClientConnectionsResponse; - message.connection_paths = []; - if ( - object.connection_paths !== undefined && - object.connection_paths !== null - ) { - for (const e of object.connection_paths) { - message.connection_paths.push(e); - } - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryConnectionClientStateRequest: object = { connection_id: "" }; - -export const QueryConnectionClientStateRequest = { - encode( - message: QueryConnectionClientStateRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.connection_id !== "") { - writer.uint32(10).string(message.connection_id); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConnectionClientStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConnectionClientStateRequest, - } as QueryConnectionClientStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConnectionClientStateRequest { - const message = { - ...baseQueryConnectionClientStateRequest, - } as QueryConnectionClientStateRequest; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = String(object.connection_id); - } else { - message.connection_id = ""; - } - return message; - }, - - toJSON(message: QueryConnectionClientStateRequest): unknown { - const obj: any = {}; - message.connection_id !== undefined && - (obj.connection_id = message.connection_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionClientStateRequest { - const message = { - ...baseQueryConnectionClientStateRequest, - } as QueryConnectionClientStateRequest; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = object.connection_id; - } else { - message.connection_id = ""; - } - return message; - }, -}; - -const baseQueryConnectionClientStateResponse: object = {}; - -export const QueryConnectionClientStateResponse = { - encode( - message: QueryConnectionClientStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.identified_client_state !== undefined) { - IdentifiedClientState.encode( - message.identified_client_state, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.proof.length !== 0) { - writer.uint32(18).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConnectionClientStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConnectionClientStateResponse, - } as QueryConnectionClientStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identified_client_state = IdentifiedClientState.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConnectionClientStateResponse { - const message = { - ...baseQueryConnectionClientStateResponse, - } as QueryConnectionClientStateResponse; - if ( - object.identified_client_state !== undefined && - object.identified_client_state !== null - ) { - message.identified_client_state = IdentifiedClientState.fromJSON( - object.identified_client_state - ); - } else { - message.identified_client_state = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryConnectionClientStateResponse): unknown { - const obj: any = {}; - message.identified_client_state !== undefined && - (obj.identified_client_state = message.identified_client_state - ? IdentifiedClientState.toJSON(message.identified_client_state) - : undefined); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionClientStateResponse { - const message = { - ...baseQueryConnectionClientStateResponse, - } as QueryConnectionClientStateResponse; - if ( - object.identified_client_state !== undefined && - object.identified_client_state !== null - ) { - message.identified_client_state = IdentifiedClientState.fromPartial( - object.identified_client_state - ); - } else { - message.identified_client_state = undefined; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -const baseQueryConnectionConsensusStateRequest: object = { - connection_id: "", - revision_number: 0, - revision_height: 0, -}; - -export const QueryConnectionConsensusStateRequest = { - encode( - message: QueryConnectionConsensusStateRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.connection_id !== "") { - writer.uint32(10).string(message.connection_id); - } - if (message.revision_number !== 0) { - writer.uint32(16).uint64(message.revision_number); - } - if (message.revision_height !== 0) { - writer.uint32(24).uint64(message.revision_height); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConnectionConsensusStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConnectionConsensusStateRequest, - } as QueryConnectionConsensusStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.revision_number = longToNumber(reader.uint64() as Long); - break; - case 3: - message.revision_height = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConnectionConsensusStateRequest { - const message = { - ...baseQueryConnectionConsensusStateRequest, - } as QueryConnectionConsensusStateRequest; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = String(object.connection_id); - } else { - message.connection_id = ""; - } - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = Number(object.revision_number); - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = Number(object.revision_height); - } else { - message.revision_height = 0; - } - return message; - }, - - toJSON(message: QueryConnectionConsensusStateRequest): unknown { - const obj: any = {}; - message.connection_id !== undefined && - (obj.connection_id = message.connection_id); - message.revision_number !== undefined && - (obj.revision_number = message.revision_number); - message.revision_height !== undefined && - (obj.revision_height = message.revision_height); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionConsensusStateRequest { - const message = { - ...baseQueryConnectionConsensusStateRequest, - } as QueryConnectionConsensusStateRequest; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = object.connection_id; - } else { - message.connection_id = ""; - } - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = object.revision_number; - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = object.revision_height; - } else { - message.revision_height = 0; - } - return message; - }, -}; - -const baseQueryConnectionConsensusStateResponse: object = { client_id: "" }; - -export const QueryConnectionConsensusStateResponse = { - encode( - message: QueryConnectionConsensusStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(10).fork()).ldelim(); - } - if (message.client_id !== "") { - writer.uint32(18).string(message.client_id); - } - if (message.proof.length !== 0) { - writer.uint32(26).bytes(message.proof); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryConnectionConsensusStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryConnectionConsensusStateResponse, - } as QueryConnectionConsensusStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - case 2: - message.client_id = reader.string(); - break; - case 3: - message.proof = reader.bytes(); - break; - case 4: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryConnectionConsensusStateResponse { - const message = { - ...baseQueryConnectionConsensusStateResponse, - } as QueryConnectionConsensusStateResponse; - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = bytesFromBase64(object.proof); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, - - toJSON(message: QueryConnectionConsensusStateResponse): unknown { - const obj: any = {}; - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - message.client_id !== undefined && (obj.client_id = message.client_id); - message.proof !== undefined && - (obj.proof = base64FromBytes( - message.proof !== undefined ? message.proof : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryConnectionConsensusStateResponse { - const message = { - ...baseQueryConnectionConsensusStateResponse, - } as QueryConnectionConsensusStateResponse; - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = object.proof; - } else { - message.proof = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - return message; - }, -}; - -/** Query provides defines the gRPC querier service */ -export interface Query { - /** Connection queries an IBC connection end. */ - Connection(request: QueryConnectionRequest): Promise; - /** Connections queries all the IBC connections of a chain. */ - Connections( - request: QueryConnectionsRequest - ): Promise; - /** - * ClientConnections queries the connection paths associated with a client - * state. - */ - ClientConnections( - request: QueryClientConnectionsRequest - ): Promise; - /** - * ConnectionClientState queries the client state associated with the - * connection. - */ - ConnectionClientState( - request: QueryConnectionClientStateRequest - ): Promise; - /** - * ConnectionConsensusState queries the consensus state associated with the - * connection. - */ - ConnectionConsensusState( - request: QueryConnectionConsensusStateRequest - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Connection( - request: QueryConnectionRequest - ): Promise { - const data = QueryConnectionRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.connection.v1.Query", - "Connection", - data - ); - return promise.then((data) => - QueryConnectionResponse.decode(new Reader(data)) - ); - } - - Connections( - request: QueryConnectionsRequest - ): Promise { - const data = QueryConnectionsRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.connection.v1.Query", - "Connections", - data - ); - return promise.then((data) => - QueryConnectionsResponse.decode(new Reader(data)) - ); - } - - ClientConnections( - request: QueryClientConnectionsRequest - ): Promise { - const data = QueryClientConnectionsRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.connection.v1.Query", - "ClientConnections", - data - ); - return promise.then((data) => - QueryClientConnectionsResponse.decode(new Reader(data)) - ); - } - - ConnectionClientState( - request: QueryConnectionClientStateRequest - ): Promise { - const data = QueryConnectionClientStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.connection.v1.Query", - "ConnectionClientState", - data - ); - return promise.then((data) => - QueryConnectionClientStateResponse.decode(new Reader(data)) - ); - } - - ConnectionConsensusState( - request: QueryConnectionConsensusStateRequest - ): Promise { - const data = QueryConnectionConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.connection.v1.Query", - "ConnectionConsensusState", - data - ); - return promise.then((data) => - QueryConnectionConsensusStateResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/tx.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/tx.ts deleted file mode 100644 index e598fe16..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/ibc/core/connection/v1/tx.ts +++ /dev/null @@ -1,1300 +0,0 @@ -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - Counterparty, - Version, -} from "../../../../ibc/core/connection/v1/connection"; -import { Any } from "../../../../google/protobuf/any"; -import { Height } from "../../../../ibc/core/client/v1/client"; - -export const protobufPackage = "ibc.core.connection.v1"; - -/** - * MsgConnectionOpenInit defines the msg sent by an account on Chain A to - * initialize a connection with Chain B. - */ -export interface MsgConnectionOpenInit { - client_id: string; - counterparty: Counterparty | undefined; - version: Version | undefined; - delay_period: number; - signer: string; -} - -/** - * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response - * type. - */ -export interface MsgConnectionOpenInitResponse {} - -/** - * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a - * connection on Chain B. - */ -export interface MsgConnectionOpenTry { - client_id: string; - /** - * in the case of crossing hello's, when both chains call OpenInit, we need - * the connection identifier of the previous connection in state INIT - */ - previous_connection_id: string; - client_state: Any | undefined; - counterparty: Counterparty | undefined; - delay_period: number; - counterparty_versions: Version[]; - proof_height: Height | undefined; - /** - * proof of the initialization the connection on Chain A: `UNITIALIZED -> - * INIT` - */ - proof_init: Uint8Array; - /** proof of client state included in message */ - proof_client: Uint8Array; - /** proof of client consensus state */ - proof_consensus: Uint8Array; - consensus_height: Height | undefined; - signer: string; -} - -/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ -export interface MsgConnectionOpenTryResponse {} - -/** - * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to - * acknowledge the change of connection state to TRYOPEN on Chain B. - */ -export interface MsgConnectionOpenAck { - connection_id: string; - counterparty_connection_id: string; - version: Version | undefined; - client_state: Any | undefined; - proof_height: Height | undefined; - /** - * proof of the initialization the connection on Chain B: `UNITIALIZED -> - * TRYOPEN` - */ - proof_try: Uint8Array; - /** proof of client state included in message */ - proof_client: Uint8Array; - /** proof of client consensus state */ - proof_consensus: Uint8Array; - consensus_height: Height | undefined; - signer: string; -} - -/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ -export interface MsgConnectionOpenAckResponse {} - -/** - * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to - * acknowledge the change of connection state to OPEN on Chain A. - */ -export interface MsgConnectionOpenConfirm { - connection_id: string; - /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ - proof_ack: Uint8Array; - proof_height: Height | undefined; - signer: string; -} - -/** - * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm - * response type. - */ -export interface MsgConnectionOpenConfirmResponse {} - -const baseMsgConnectionOpenInit: object = { - client_id: "", - delay_period: 0, - signer: "", -}; - -export const MsgConnectionOpenInit = { - encode( - message: MsgConnectionOpenInit, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.counterparty !== undefined) { - Counterparty.encode( - message.counterparty, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.version !== undefined) { - Version.encode(message.version, writer.uint32(26).fork()).ldelim(); - } - if (message.delay_period !== 0) { - writer.uint32(32).uint64(message.delay_period); - } - if (message.signer !== "") { - writer.uint32(42).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgConnectionOpenInit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgConnectionOpenInit } as MsgConnectionOpenInit; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.counterparty = Counterparty.decode(reader, reader.uint32()); - break; - case 3: - message.version = Version.decode(reader, reader.uint32()); - break; - case 4: - message.delay_period = longToNumber(reader.uint64() as Long); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgConnectionOpenInit { - const message = { ...baseMsgConnectionOpenInit } as MsgConnectionOpenInit; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromJSON(object.counterparty); - } else { - message.counterparty = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = Version.fromJSON(object.version); - } else { - message.version = undefined; - } - if (object.delay_period !== undefined && object.delay_period !== null) { - message.delay_period = Number(object.delay_period); - } else { - message.delay_period = 0; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgConnectionOpenInit): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.counterparty !== undefined && - (obj.counterparty = message.counterparty - ? Counterparty.toJSON(message.counterparty) - : undefined); - message.version !== undefined && - (obj.version = message.version - ? Version.toJSON(message.version) - : undefined); - message.delay_period !== undefined && - (obj.delay_period = message.delay_period); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgConnectionOpenInit { - const message = { ...baseMsgConnectionOpenInit } as MsgConnectionOpenInit; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromPartial(object.counterparty); - } else { - message.counterparty = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = Version.fromPartial(object.version); - } else { - message.version = undefined; - } - if (object.delay_period !== undefined && object.delay_period !== null) { - message.delay_period = object.delay_period; - } else { - message.delay_period = 0; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgConnectionOpenInitResponse: object = {}; - -export const MsgConnectionOpenInitResponse = { - encode( - _: MsgConnectionOpenInitResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgConnectionOpenInitResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgConnectionOpenInitResponse, - } as MsgConnectionOpenInitResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgConnectionOpenInitResponse { - const message = { - ...baseMsgConnectionOpenInitResponse, - } as MsgConnectionOpenInitResponse; - return message; - }, - - toJSON(_: MsgConnectionOpenInitResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgConnectionOpenInitResponse { - const message = { - ...baseMsgConnectionOpenInitResponse, - } as MsgConnectionOpenInitResponse; - return message; - }, -}; - -const baseMsgConnectionOpenTry: object = { - client_id: "", - previous_connection_id: "", - delay_period: 0, - signer: "", -}; - -export const MsgConnectionOpenTry = { - encode( - message: MsgConnectionOpenTry, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.previous_connection_id !== "") { - writer.uint32(18).string(message.previous_connection_id); - } - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(26).fork()).ldelim(); - } - if (message.counterparty !== undefined) { - Counterparty.encode( - message.counterparty, - writer.uint32(34).fork() - ).ldelim(); - } - if (message.delay_period !== 0) { - writer.uint32(40).uint64(message.delay_period); - } - for (const v of message.counterparty_versions) { - Version.encode(v!, writer.uint32(50).fork()).ldelim(); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(58).fork()).ldelim(); - } - if (message.proof_init.length !== 0) { - writer.uint32(66).bytes(message.proof_init); - } - if (message.proof_client.length !== 0) { - writer.uint32(74).bytes(message.proof_client); - } - if (message.proof_consensus.length !== 0) { - writer.uint32(82).bytes(message.proof_consensus); - } - if (message.consensus_height !== undefined) { - Height.encode( - message.consensus_height, - writer.uint32(90).fork() - ).ldelim(); - } - if (message.signer !== "") { - writer.uint32(98).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgConnectionOpenTry { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgConnectionOpenTry } as MsgConnectionOpenTry; - message.counterparty_versions = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.previous_connection_id = reader.string(); - break; - case 3: - message.client_state = Any.decode(reader, reader.uint32()); - break; - case 4: - message.counterparty = Counterparty.decode(reader, reader.uint32()); - break; - case 5: - message.delay_period = longToNumber(reader.uint64() as Long); - break; - case 6: - message.counterparty_versions.push( - Version.decode(reader, reader.uint32()) - ); - break; - case 7: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 8: - message.proof_init = reader.bytes(); - break; - case 9: - message.proof_client = reader.bytes(); - break; - case 10: - message.proof_consensus = reader.bytes(); - break; - case 11: - message.consensus_height = Height.decode(reader, reader.uint32()); - break; - case 12: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgConnectionOpenTry { - const message = { ...baseMsgConnectionOpenTry } as MsgConnectionOpenTry; - message.counterparty_versions = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if ( - object.previous_connection_id !== undefined && - object.previous_connection_id !== null - ) { - message.previous_connection_id = String(object.previous_connection_id); - } else { - message.previous_connection_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromJSON(object.counterparty); - } else { - message.counterparty = undefined; - } - if (object.delay_period !== undefined && object.delay_period !== null) { - message.delay_period = Number(object.delay_period); - } else { - message.delay_period = 0; - } - if ( - object.counterparty_versions !== undefined && - object.counterparty_versions !== null - ) { - for (const e of object.counterparty_versions) { - message.counterparty_versions.push(Version.fromJSON(e)); - } - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.proof_init !== undefined && object.proof_init !== null) { - message.proof_init = bytesFromBase64(object.proof_init); - } - if (object.proof_client !== undefined && object.proof_client !== null) { - message.proof_client = bytesFromBase64(object.proof_client); - } - if ( - object.proof_consensus !== undefined && - object.proof_consensus !== null - ) { - message.proof_consensus = bytesFromBase64(object.proof_consensus); - } - if ( - object.consensus_height !== undefined && - object.consensus_height !== null - ) { - message.consensus_height = Height.fromJSON(object.consensus_height); - } else { - message.consensus_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgConnectionOpenTry): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.previous_connection_id !== undefined && - (obj.previous_connection_id = message.previous_connection_id); - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - message.counterparty !== undefined && - (obj.counterparty = message.counterparty - ? Counterparty.toJSON(message.counterparty) - : undefined); - message.delay_period !== undefined && - (obj.delay_period = message.delay_period); - if (message.counterparty_versions) { - obj.counterparty_versions = message.counterparty_versions.map((e) => - e ? Version.toJSON(e) : undefined - ); - } else { - obj.counterparty_versions = []; - } - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.proof_init !== undefined && - (obj.proof_init = base64FromBytes( - message.proof_init !== undefined ? message.proof_init : new Uint8Array() - )); - message.proof_client !== undefined && - (obj.proof_client = base64FromBytes( - message.proof_client !== undefined - ? message.proof_client - : new Uint8Array() - )); - message.proof_consensus !== undefined && - (obj.proof_consensus = base64FromBytes( - message.proof_consensus !== undefined - ? message.proof_consensus - : new Uint8Array() - )); - message.consensus_height !== undefined && - (obj.consensus_height = message.consensus_height - ? Height.toJSON(message.consensus_height) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgConnectionOpenTry { - const message = { ...baseMsgConnectionOpenTry } as MsgConnectionOpenTry; - message.counterparty_versions = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if ( - object.previous_connection_id !== undefined && - object.previous_connection_id !== null - ) { - message.previous_connection_id = object.previous_connection_id; - } else { - message.previous_connection_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromPartial(object.counterparty); - } else { - message.counterparty = undefined; - } - if (object.delay_period !== undefined && object.delay_period !== null) { - message.delay_period = object.delay_period; - } else { - message.delay_period = 0; - } - if ( - object.counterparty_versions !== undefined && - object.counterparty_versions !== null - ) { - for (const e of object.counterparty_versions) { - message.counterparty_versions.push(Version.fromPartial(e)); - } - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.proof_init !== undefined && object.proof_init !== null) { - message.proof_init = object.proof_init; - } else { - message.proof_init = new Uint8Array(); - } - if (object.proof_client !== undefined && object.proof_client !== null) { - message.proof_client = object.proof_client; - } else { - message.proof_client = new Uint8Array(); - } - if ( - object.proof_consensus !== undefined && - object.proof_consensus !== null - ) { - message.proof_consensus = object.proof_consensus; - } else { - message.proof_consensus = new Uint8Array(); - } - if ( - object.consensus_height !== undefined && - object.consensus_height !== null - ) { - message.consensus_height = Height.fromPartial(object.consensus_height); - } else { - message.consensus_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgConnectionOpenTryResponse: object = {}; - -export const MsgConnectionOpenTryResponse = { - encode( - _: MsgConnectionOpenTryResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgConnectionOpenTryResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgConnectionOpenTryResponse, - } as MsgConnectionOpenTryResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgConnectionOpenTryResponse { - const message = { - ...baseMsgConnectionOpenTryResponse, - } as MsgConnectionOpenTryResponse; - return message; - }, - - toJSON(_: MsgConnectionOpenTryResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgConnectionOpenTryResponse { - const message = { - ...baseMsgConnectionOpenTryResponse, - } as MsgConnectionOpenTryResponse; - return message; - }, -}; - -const baseMsgConnectionOpenAck: object = { - connection_id: "", - counterparty_connection_id: "", - signer: "", -}; - -export const MsgConnectionOpenAck = { - encode( - message: MsgConnectionOpenAck, - writer: Writer = Writer.create() - ): Writer { - if (message.connection_id !== "") { - writer.uint32(10).string(message.connection_id); - } - if (message.counterparty_connection_id !== "") { - writer.uint32(18).string(message.counterparty_connection_id); - } - if (message.version !== undefined) { - Version.encode(message.version, writer.uint32(26).fork()).ldelim(); - } - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(34).fork()).ldelim(); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(42).fork()).ldelim(); - } - if (message.proof_try.length !== 0) { - writer.uint32(50).bytes(message.proof_try); - } - if (message.proof_client.length !== 0) { - writer.uint32(58).bytes(message.proof_client); - } - if (message.proof_consensus.length !== 0) { - writer.uint32(66).bytes(message.proof_consensus); - } - if (message.consensus_height !== undefined) { - Height.encode( - message.consensus_height, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.signer !== "") { - writer.uint32(82).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgConnectionOpenAck { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgConnectionOpenAck } as MsgConnectionOpenAck; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.counterparty_connection_id = reader.string(); - break; - case 3: - message.version = Version.decode(reader, reader.uint32()); - break; - case 4: - message.client_state = Any.decode(reader, reader.uint32()); - break; - case 5: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 6: - message.proof_try = reader.bytes(); - break; - case 7: - message.proof_client = reader.bytes(); - break; - case 8: - message.proof_consensus = reader.bytes(); - break; - case 9: - message.consensus_height = Height.decode(reader, reader.uint32()); - break; - case 10: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgConnectionOpenAck { - const message = { ...baseMsgConnectionOpenAck } as MsgConnectionOpenAck; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = String(object.connection_id); - } else { - message.connection_id = ""; - } - if ( - object.counterparty_connection_id !== undefined && - object.counterparty_connection_id !== null - ) { - message.counterparty_connection_id = String( - object.counterparty_connection_id - ); - } else { - message.counterparty_connection_id = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = Version.fromJSON(object.version); - } else { - message.version = undefined; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.proof_try !== undefined && object.proof_try !== null) { - message.proof_try = bytesFromBase64(object.proof_try); - } - if (object.proof_client !== undefined && object.proof_client !== null) { - message.proof_client = bytesFromBase64(object.proof_client); - } - if ( - object.proof_consensus !== undefined && - object.proof_consensus !== null - ) { - message.proof_consensus = bytesFromBase64(object.proof_consensus); - } - if ( - object.consensus_height !== undefined && - object.consensus_height !== null - ) { - message.consensus_height = Height.fromJSON(object.consensus_height); - } else { - message.consensus_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgConnectionOpenAck): unknown { - const obj: any = {}; - message.connection_id !== undefined && - (obj.connection_id = message.connection_id); - message.counterparty_connection_id !== undefined && - (obj.counterparty_connection_id = message.counterparty_connection_id); - message.version !== undefined && - (obj.version = message.version - ? Version.toJSON(message.version) - : undefined); - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.proof_try !== undefined && - (obj.proof_try = base64FromBytes( - message.proof_try !== undefined ? message.proof_try : new Uint8Array() - )); - message.proof_client !== undefined && - (obj.proof_client = base64FromBytes( - message.proof_client !== undefined - ? message.proof_client - : new Uint8Array() - )); - message.proof_consensus !== undefined && - (obj.proof_consensus = base64FromBytes( - message.proof_consensus !== undefined - ? message.proof_consensus - : new Uint8Array() - )); - message.consensus_height !== undefined && - (obj.consensus_height = message.consensus_height - ? Height.toJSON(message.consensus_height) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial(object: DeepPartial): MsgConnectionOpenAck { - const message = { ...baseMsgConnectionOpenAck } as MsgConnectionOpenAck; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = object.connection_id; - } else { - message.connection_id = ""; - } - if ( - object.counterparty_connection_id !== undefined && - object.counterparty_connection_id !== null - ) { - message.counterparty_connection_id = object.counterparty_connection_id; - } else { - message.counterparty_connection_id = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = Version.fromPartial(object.version); - } else { - message.version = undefined; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.proof_try !== undefined && object.proof_try !== null) { - message.proof_try = object.proof_try; - } else { - message.proof_try = new Uint8Array(); - } - if (object.proof_client !== undefined && object.proof_client !== null) { - message.proof_client = object.proof_client; - } else { - message.proof_client = new Uint8Array(); - } - if ( - object.proof_consensus !== undefined && - object.proof_consensus !== null - ) { - message.proof_consensus = object.proof_consensus; - } else { - message.proof_consensus = new Uint8Array(); - } - if ( - object.consensus_height !== undefined && - object.consensus_height !== null - ) { - message.consensus_height = Height.fromPartial(object.consensus_height); - } else { - message.consensus_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgConnectionOpenAckResponse: object = {}; - -export const MsgConnectionOpenAckResponse = { - encode( - _: MsgConnectionOpenAckResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgConnectionOpenAckResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgConnectionOpenAckResponse, - } as MsgConnectionOpenAckResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgConnectionOpenAckResponse { - const message = { - ...baseMsgConnectionOpenAckResponse, - } as MsgConnectionOpenAckResponse; - return message; - }, - - toJSON(_: MsgConnectionOpenAckResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgConnectionOpenAckResponse { - const message = { - ...baseMsgConnectionOpenAckResponse, - } as MsgConnectionOpenAckResponse; - return message; - }, -}; - -const baseMsgConnectionOpenConfirm: object = { connection_id: "", signer: "" }; - -export const MsgConnectionOpenConfirm = { - encode( - message: MsgConnectionOpenConfirm, - writer: Writer = Writer.create() - ): Writer { - if (message.connection_id !== "") { - writer.uint32(10).string(message.connection_id); - } - if (message.proof_ack.length !== 0) { - writer.uint32(18).bytes(message.proof_ack); - } - if (message.proof_height !== undefined) { - Height.encode(message.proof_height, writer.uint32(26).fork()).ldelim(); - } - if (message.signer !== "") { - writer.uint32(34).string(message.signer); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgConnectionOpenConfirm { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgConnectionOpenConfirm, - } as MsgConnectionOpenConfirm; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.proof_ack = reader.bytes(); - break; - case 3: - message.proof_height = Height.decode(reader, reader.uint32()); - break; - case 4: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgConnectionOpenConfirm { - const message = { - ...baseMsgConnectionOpenConfirm, - } as MsgConnectionOpenConfirm; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = String(object.connection_id); - } else { - message.connection_id = ""; - } - if (object.proof_ack !== undefined && object.proof_ack !== null) { - message.proof_ack = bytesFromBase64(object.proof_ack); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromJSON(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgConnectionOpenConfirm): unknown { - const obj: any = {}; - message.connection_id !== undefined && - (obj.connection_id = message.connection_id); - message.proof_ack !== undefined && - (obj.proof_ack = base64FromBytes( - message.proof_ack !== undefined ? message.proof_ack : new Uint8Array() - )); - message.proof_height !== undefined && - (obj.proof_height = message.proof_height - ? Height.toJSON(message.proof_height) - : undefined); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgConnectionOpenConfirm { - const message = { - ...baseMsgConnectionOpenConfirm, - } as MsgConnectionOpenConfirm; - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = object.connection_id; - } else { - message.connection_id = ""; - } - if (object.proof_ack !== undefined && object.proof_ack !== null) { - message.proof_ack = object.proof_ack; - } else { - message.proof_ack = new Uint8Array(); - } - if (object.proof_height !== undefined && object.proof_height !== null) { - message.proof_height = Height.fromPartial(object.proof_height); - } else { - message.proof_height = undefined; - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgConnectionOpenConfirmResponse: object = {}; - -export const MsgConnectionOpenConfirmResponse = { - encode( - _: MsgConnectionOpenConfirmResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgConnectionOpenConfirmResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgConnectionOpenConfirmResponse, - } as MsgConnectionOpenConfirmResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgConnectionOpenConfirmResponse { - const message = { - ...baseMsgConnectionOpenConfirmResponse, - } as MsgConnectionOpenConfirmResponse; - return message; - }, - - toJSON(_: MsgConnectionOpenConfirmResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgConnectionOpenConfirmResponse { - const message = { - ...baseMsgConnectionOpenConfirmResponse, - } as MsgConnectionOpenConfirmResponse; - return message; - }, -}; - -/** Msg defines the ibc/connection Msg service. */ -export interface Msg { - /** ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ - ConnectionOpenInit( - request: MsgConnectionOpenInit - ): Promise; - /** ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. */ - ConnectionOpenTry( - request: MsgConnectionOpenTry - ): Promise; - /** ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. */ - ConnectionOpenAck( - request: MsgConnectionOpenAck - ): Promise; - /** - * ConnectionOpenConfirm defines a rpc handler method for - * MsgConnectionOpenConfirm. - */ - ConnectionOpenConfirm( - request: MsgConnectionOpenConfirm - ): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - ConnectionOpenInit( - request: MsgConnectionOpenInit - ): Promise { - const data = MsgConnectionOpenInit.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.connection.v1.Msg", - "ConnectionOpenInit", - data - ); - return promise.then((data) => - MsgConnectionOpenInitResponse.decode(new Reader(data)) - ); - } - - ConnectionOpenTry( - request: MsgConnectionOpenTry - ): Promise { - const data = MsgConnectionOpenTry.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.connection.v1.Msg", - "ConnectionOpenTry", - data - ); - return promise.then((data) => - MsgConnectionOpenTryResponse.decode(new Reader(data)) - ); - } - - ConnectionOpenAck( - request: MsgConnectionOpenAck - ): Promise { - const data = MsgConnectionOpenAck.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.connection.v1.Msg", - "ConnectionOpenAck", - data - ); - return promise.then((data) => - MsgConnectionOpenAckResponse.decode(new Reader(data)) - ); - } - - ConnectionOpenConfirm( - request: MsgConnectionOpenConfirm - ): Promise { - const data = MsgConnectionOpenConfirm.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.connection.v1.Msg", - "ConnectionOpenConfirm", - data - ); - return promise.then((data) => - MsgConnectionOpenConfirmResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/proofs.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/proofs.ts deleted file mode 100644 index 86dd3c21..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/module/types/proofs.ts +++ /dev/null @@ -1,1831 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "ics23"; - -export enum HashOp { - /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ - NO_HASH = 0, - SHA256 = 1, - SHA512 = 2, - KECCAK = 3, - RIPEMD160 = 4, - /** BITCOIN - ripemd160(sha256(x)) */ - BITCOIN = 5, - UNRECOGNIZED = -1, -} - -export function hashOpFromJSON(object: any): HashOp { - switch (object) { - case 0: - case "NO_HASH": - return HashOp.NO_HASH; - case 1: - case "SHA256": - return HashOp.SHA256; - case 2: - case "SHA512": - return HashOp.SHA512; - case 3: - case "KECCAK": - return HashOp.KECCAK; - case 4: - case "RIPEMD160": - return HashOp.RIPEMD160; - case 5: - case "BITCOIN": - return HashOp.BITCOIN; - case -1: - case "UNRECOGNIZED": - default: - return HashOp.UNRECOGNIZED; - } -} - -export function hashOpToJSON(object: HashOp): string { - switch (object) { - case HashOp.NO_HASH: - return "NO_HASH"; - case HashOp.SHA256: - return "SHA256"; - case HashOp.SHA512: - return "SHA512"; - case HashOp.KECCAK: - return "KECCAK"; - case HashOp.RIPEMD160: - return "RIPEMD160"; - case HashOp.BITCOIN: - return "BITCOIN"; - default: - return "UNKNOWN"; - } -} - -/** - * LengthOp defines how to process the key and value of the LeafOp - * to include length information. After encoding the length with the given - * algorithm, the length will be prepended to the key and value bytes. - * (Each one with it's own encoded length) - */ -export enum LengthOp { - /** NO_PREFIX - NO_PREFIX don't include any length info */ - NO_PREFIX = 0, - /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length */ - VAR_PROTO = 1, - /** VAR_RLP - VAR_RLP uses rlp int encoding of the length */ - VAR_RLP = 2, - /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer */ - FIXED32_BIG = 3, - /** FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer */ - FIXED32_LITTLE = 4, - /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer */ - FIXED64_BIG = 5, - /** FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer */ - FIXED64_LITTLE = 6, - /** REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) */ - REQUIRE_32_BYTES = 7, - /** REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) */ - REQUIRE_64_BYTES = 8, - UNRECOGNIZED = -1, -} - -export function lengthOpFromJSON(object: any): LengthOp { - switch (object) { - case 0: - case "NO_PREFIX": - return LengthOp.NO_PREFIX; - case 1: - case "VAR_PROTO": - return LengthOp.VAR_PROTO; - case 2: - case "VAR_RLP": - return LengthOp.VAR_RLP; - case 3: - case "FIXED32_BIG": - return LengthOp.FIXED32_BIG; - case 4: - case "FIXED32_LITTLE": - return LengthOp.FIXED32_LITTLE; - case 5: - case "FIXED64_BIG": - return LengthOp.FIXED64_BIG; - case 6: - case "FIXED64_LITTLE": - return LengthOp.FIXED64_LITTLE; - case 7: - case "REQUIRE_32_BYTES": - return LengthOp.REQUIRE_32_BYTES; - case 8: - case "REQUIRE_64_BYTES": - return LengthOp.REQUIRE_64_BYTES; - case -1: - case "UNRECOGNIZED": - default: - return LengthOp.UNRECOGNIZED; - } -} - -export function lengthOpToJSON(object: LengthOp): string { - switch (object) { - case LengthOp.NO_PREFIX: - return "NO_PREFIX"; - case LengthOp.VAR_PROTO: - return "VAR_PROTO"; - case LengthOp.VAR_RLP: - return "VAR_RLP"; - case LengthOp.FIXED32_BIG: - return "FIXED32_BIG"; - case LengthOp.FIXED32_LITTLE: - return "FIXED32_LITTLE"; - case LengthOp.FIXED64_BIG: - return "FIXED64_BIG"; - case LengthOp.FIXED64_LITTLE: - return "FIXED64_LITTLE"; - case LengthOp.REQUIRE_32_BYTES: - return "REQUIRE_32_BYTES"; - case LengthOp.REQUIRE_64_BYTES: - return "REQUIRE_64_BYTES"; - default: - return "UNKNOWN"; - } -} - -/** - * ExistenceProof takes a key and a value and a set of steps to perform on it. - * The result of peforming all these steps will provide a "root hash", which can - * be compared to the value in a header. - * - * Since it is computationally infeasible to produce a hash collission for any of the used - * cryptographic hash functions, if someone can provide a series of operations to transform - * a given key and value into a root hash that matches some trusted root, these key and values - * must be in the referenced merkle tree. - * - * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, - * which should be controlled by a spec. Eg. with lengthOp as NONE, - * prefix = FOO, key = BAR, value = CHOICE - * and - * prefix = F, key = OOBAR, value = CHOICE - * would produce the same value. - * - * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field - * in the ProofSpec is valuable to prevent this mutability. And why all trees should - * length-prefix the data before hashing it. - */ -export interface ExistenceProof { - key: Uint8Array; - value: Uint8Array; - leaf: LeafOp | undefined; - path: InnerOp[]; -} - -/** - * NonExistenceProof takes a proof of two neighbors, one left of the desired key, - * one right of the desired key. If both proofs are valid AND they are neighbors, - * then there is no valid proof for the given key. - */ -export interface NonExistenceProof { - /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; - left: ExistenceProof | undefined; - right: ExistenceProof | undefined; -} - -/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ -export interface CommitmentProof { - exist: ExistenceProof | undefined; - nonexist: NonExistenceProof | undefined; - batch: BatchProof | undefined; - compressed: CompressedBatchProof | undefined; -} - -/** - * LeafOp represents the raw key-value data we wish to prove, and - * must be flexible to represent the internal transformation from - * the original key-value pairs into the basis hash, for many existing - * merkle trees. - * - * key and value are passed in. So that the signature of this operation is: - * leafOp(key, value) -> output - * - * To process this, first prehash the keys and values if needed (ANY means no hash in this case): - * hkey = prehashKey(key) - * hvalue = prehashValue(value) - * - * Then combine the bytes, and hash it - * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) - */ -export interface LeafOp { - hash: HashOp; - prehash_key: HashOp; - prehash_value: HashOp; - length: LengthOp; - /** - * prefix is a fixed bytes that may optionally be included at the beginning to differentiate - * a leaf node from an inner node. - */ - prefix: Uint8Array; -} - -/** - * InnerOp represents a merkle-proof step that is not a leaf. - * It represents concatenating two children and hashing them to provide the next result. - * - * The result of the previous step is passed in, so the signature of this op is: - * innerOp(child) -> output - * - * The result of applying InnerOp should be: - * output = op.hash(op.prefix || child || op.suffix) - * - * where the || operator is concatenation of binary data, - * and child is the result of hashing all the tree below this step. - * - * Any special data, like prepending child with the length, or prepending the entire operation with - * some value to differentiate from leaf nodes, should be included in prefix and suffix. - * If either of prefix or suffix is empty, we just treat it as an empty string - */ -export interface InnerOp { - hash: HashOp; - prefix: Uint8Array; - suffix: Uint8Array; -} - -/** - * ProofSpec defines what the expected parameters are for a given proof type. - * This can be stored in the client and used to validate any incoming proofs. - * - * verify(ProofSpec, Proof) -> Proof | Error - * - * As demonstrated in tests, if we don't fix the algorithm used to calculate the - * LeafHash for a given tree, there are many possible key-value pairs that can - * generate a given hash (by interpretting the preimage differently). - * We need this for proper security, requires client knows a priori what - * tree format server uses. But not in code, rather a configuration object. - */ -export interface ProofSpec { - /** - * any field in the ExistenceProof must be the same as in this spec. - * except Prefix, which is just the first bytes of prefix (spec can be longer) - */ - leaf_spec: LeafOp | undefined; - inner_spec: InnerSpec | undefined; - /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ - max_depth: number; - /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ - min_depth: number; -} - -/** - * InnerSpec contains all store-specific structure info to determine if two proofs from a - * given store are neighbors. - * - * This enables: - * - * isLeftMost(spec: InnerSpec, op: InnerOp) - * isRightMost(spec: InnerSpec, op: InnerOp) - * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) - */ -export interface InnerSpec { - /** - * Child order is the ordering of the children node, must count from 0 - * iavl tree is [0, 1] (left then right) - * merk is [0, 2, 1] (left, right, here) - */ - child_order: number[]; - child_size: number; - min_prefix_length: number; - max_prefix_length: number; - /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ - empty_child: Uint8Array; - /** hash is the algorithm that must be used for each InnerOp */ - hash: HashOp; -} - -/** BatchProof is a group of multiple proof types than can be compressed */ -export interface BatchProof { - entries: BatchEntry[]; -} - -/** Use BatchEntry not CommitmentProof, to avoid recursion */ -export interface BatchEntry { - exist: ExistenceProof | undefined; - nonexist: NonExistenceProof | undefined; -} - -export interface CompressedBatchProof { - entries: CompressedBatchEntry[]; - lookup_inners: InnerOp[]; -} - -/** Use BatchEntry not CommitmentProof, to avoid recursion */ -export interface CompressedBatchEntry { - exist: CompressedExistenceProof | undefined; - nonexist: CompressedNonExistenceProof | undefined; -} - -export interface CompressedExistenceProof { - key: Uint8Array; - value: Uint8Array; - leaf: LeafOp | undefined; - /** these are indexes into the lookup_inners table in CompressedBatchProof */ - path: number[]; -} - -export interface CompressedNonExistenceProof { - /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; - left: CompressedExistenceProof | undefined; - right: CompressedExistenceProof | undefined; -} - -const baseExistenceProof: object = {}; - -export const ExistenceProof = { - encode(message: ExistenceProof, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - if (message.leaf !== undefined) { - LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.path) { - InnerOp.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExistenceProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExistenceProof } as ExistenceProof; - message.path = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - case 3: - message.leaf = LeafOp.decode(reader, reader.uint32()); - break; - case 4: - message.path.push(InnerOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExistenceProof { - const message = { ...baseExistenceProof } as ExistenceProof; - message.path = []; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - if (object.leaf !== undefined && object.leaf !== null) { - message.leaf = LeafOp.fromJSON(object.leaf); - } else { - message.leaf = undefined; - } - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(InnerOp.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExistenceProof): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - message.leaf !== undefined && - (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); - if (message.path) { - obj.path = message.path.map((e) => (e ? InnerOp.toJSON(e) : undefined)); - } else { - obj.path = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ExistenceProof { - const message = { ...baseExistenceProof } as ExistenceProof; - message.path = []; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - if (object.leaf !== undefined && object.leaf !== null) { - message.leaf = LeafOp.fromPartial(object.leaf); - } else { - message.leaf = undefined; - } - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(InnerOp.fromPartial(e)); - } - } - return message; - }, -}; - -const baseNonExistenceProof: object = {}; - -export const NonExistenceProof = { - encode(message: NonExistenceProof, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.left !== undefined) { - ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); - } - if (message.right !== undefined) { - ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): NonExistenceProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseNonExistenceProof } as NonExistenceProof; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.left = ExistenceProof.decode(reader, reader.uint32()); - break; - case 3: - message.right = ExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): NonExistenceProof { - const message = { ...baseNonExistenceProof } as NonExistenceProof; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.left !== undefined && object.left !== null) { - message.left = ExistenceProof.fromJSON(object.left); - } else { - message.left = undefined; - } - if (object.right !== undefined && object.right !== null) { - message.right = ExistenceProof.fromJSON(object.right); - } else { - message.right = undefined; - } - return message; - }, - - toJSON(message: NonExistenceProof): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.left !== undefined && - (obj.left = message.left - ? ExistenceProof.toJSON(message.left) - : undefined); - message.right !== undefined && - (obj.right = message.right - ? ExistenceProof.toJSON(message.right) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): NonExistenceProof { - const message = { ...baseNonExistenceProof } as NonExistenceProof; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.left !== undefined && object.left !== null) { - message.left = ExistenceProof.fromPartial(object.left); - } else { - message.left = undefined; - } - if (object.right !== undefined && object.right !== null) { - message.right = ExistenceProof.fromPartial(object.right); - } else { - message.right = undefined; - } - return message; - }, -}; - -const baseCommitmentProof: object = {}; - -export const CommitmentProof = { - encode(message: CommitmentProof, writer: Writer = Writer.create()): Writer { - if (message.exist !== undefined) { - ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); - } - if (message.nonexist !== undefined) { - NonExistenceProof.encode( - message.nonexist, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.batch !== undefined) { - BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim(); - } - if (message.compressed !== undefined) { - CompressedBatchProof.encode( - message.compressed, - writer.uint32(34).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CommitmentProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommitmentProof } as CommitmentProof; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exist = ExistenceProof.decode(reader, reader.uint32()); - break; - case 2: - message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); - break; - case 3: - message.batch = BatchProof.decode(reader, reader.uint32()); - break; - case 4: - message.compressed = CompressedBatchProof.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CommitmentProof { - const message = { ...baseCommitmentProof } as CommitmentProof; - if (object.exist !== undefined && object.exist !== null) { - message.exist = ExistenceProof.fromJSON(object.exist); - } else { - message.exist = undefined; - } - if (object.nonexist !== undefined && object.nonexist !== null) { - message.nonexist = NonExistenceProof.fromJSON(object.nonexist); - } else { - message.nonexist = undefined; - } - if (object.batch !== undefined && object.batch !== null) { - message.batch = BatchProof.fromJSON(object.batch); - } else { - message.batch = undefined; - } - if (object.compressed !== undefined && object.compressed !== null) { - message.compressed = CompressedBatchProof.fromJSON(object.compressed); - } else { - message.compressed = undefined; - } - return message; - }, - - toJSON(message: CommitmentProof): unknown { - const obj: any = {}; - message.exist !== undefined && - (obj.exist = message.exist - ? ExistenceProof.toJSON(message.exist) - : undefined); - message.nonexist !== undefined && - (obj.nonexist = message.nonexist - ? NonExistenceProof.toJSON(message.nonexist) - : undefined); - message.batch !== undefined && - (obj.batch = message.batch - ? BatchProof.toJSON(message.batch) - : undefined); - message.compressed !== undefined && - (obj.compressed = message.compressed - ? CompressedBatchProof.toJSON(message.compressed) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): CommitmentProof { - const message = { ...baseCommitmentProof } as CommitmentProof; - if (object.exist !== undefined && object.exist !== null) { - message.exist = ExistenceProof.fromPartial(object.exist); - } else { - message.exist = undefined; - } - if (object.nonexist !== undefined && object.nonexist !== null) { - message.nonexist = NonExistenceProof.fromPartial(object.nonexist); - } else { - message.nonexist = undefined; - } - if (object.batch !== undefined && object.batch !== null) { - message.batch = BatchProof.fromPartial(object.batch); - } else { - message.batch = undefined; - } - if (object.compressed !== undefined && object.compressed !== null) { - message.compressed = CompressedBatchProof.fromPartial(object.compressed); - } else { - message.compressed = undefined; - } - return message; - }, -}; - -const baseLeafOp: object = { - hash: 0, - prehash_key: 0, - prehash_value: 0, - length: 0, -}; - -export const LeafOp = { - encode(message: LeafOp, writer: Writer = Writer.create()): Writer { - if (message.hash !== 0) { - writer.uint32(8).int32(message.hash); - } - if (message.prehash_key !== 0) { - writer.uint32(16).int32(message.prehash_key); - } - if (message.prehash_value !== 0) { - writer.uint32(24).int32(message.prehash_value); - } - if (message.length !== 0) { - writer.uint32(32).int32(message.length); - } - if (message.prefix.length !== 0) { - writer.uint32(42).bytes(message.prefix); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): LeafOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLeafOp } as LeafOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.int32() as any; - break; - case 2: - message.prehash_key = reader.int32() as any; - break; - case 3: - message.prehash_value = reader.int32() as any; - break; - case 4: - message.length = reader.int32() as any; - break; - case 5: - message.prefix = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LeafOp { - const message = { ...baseLeafOp } as LeafOp; - if (object.hash !== undefined && object.hash !== null) { - message.hash = hashOpFromJSON(object.hash); - } else { - message.hash = 0; - } - if (object.prehash_key !== undefined && object.prehash_key !== null) { - message.prehash_key = hashOpFromJSON(object.prehash_key); - } else { - message.prehash_key = 0; - } - if (object.prehash_value !== undefined && object.prehash_value !== null) { - message.prehash_value = hashOpFromJSON(object.prehash_value); - } else { - message.prehash_value = 0; - } - if (object.length !== undefined && object.length !== null) { - message.length = lengthOpFromJSON(object.length); - } else { - message.length = 0; - } - if (object.prefix !== undefined && object.prefix !== null) { - message.prefix = bytesFromBase64(object.prefix); - } - return message; - }, - - toJSON(message: LeafOp): unknown { - const obj: any = {}; - message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); - message.prehash_key !== undefined && - (obj.prehash_key = hashOpToJSON(message.prehash_key)); - message.prehash_value !== undefined && - (obj.prehash_value = hashOpToJSON(message.prehash_value)); - message.length !== undefined && - (obj.length = lengthOpToJSON(message.length)); - message.prefix !== undefined && - (obj.prefix = base64FromBytes( - message.prefix !== undefined ? message.prefix : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): LeafOp { - const message = { ...baseLeafOp } as LeafOp; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = 0; - } - if (object.prehash_key !== undefined && object.prehash_key !== null) { - message.prehash_key = object.prehash_key; - } else { - message.prehash_key = 0; - } - if (object.prehash_value !== undefined && object.prehash_value !== null) { - message.prehash_value = object.prehash_value; - } else { - message.prehash_value = 0; - } - if (object.length !== undefined && object.length !== null) { - message.length = object.length; - } else { - message.length = 0; - } - if (object.prefix !== undefined && object.prefix !== null) { - message.prefix = object.prefix; - } else { - message.prefix = new Uint8Array(); - } - return message; - }, -}; - -const baseInnerOp: object = { hash: 0 }; - -export const InnerOp = { - encode(message: InnerOp, writer: Writer = Writer.create()): Writer { - if (message.hash !== 0) { - writer.uint32(8).int32(message.hash); - } - if (message.prefix.length !== 0) { - writer.uint32(18).bytes(message.prefix); - } - if (message.suffix.length !== 0) { - writer.uint32(26).bytes(message.suffix); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): InnerOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseInnerOp } as InnerOp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.int32() as any; - break; - case 2: - message.prefix = reader.bytes(); - break; - case 3: - message.suffix = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): InnerOp { - const message = { ...baseInnerOp } as InnerOp; - if (object.hash !== undefined && object.hash !== null) { - message.hash = hashOpFromJSON(object.hash); - } else { - message.hash = 0; - } - if (object.prefix !== undefined && object.prefix !== null) { - message.prefix = bytesFromBase64(object.prefix); - } - if (object.suffix !== undefined && object.suffix !== null) { - message.suffix = bytesFromBase64(object.suffix); - } - return message; - }, - - toJSON(message: InnerOp): unknown { - const obj: any = {}; - message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); - message.prefix !== undefined && - (obj.prefix = base64FromBytes( - message.prefix !== undefined ? message.prefix : new Uint8Array() - )); - message.suffix !== undefined && - (obj.suffix = base64FromBytes( - message.suffix !== undefined ? message.suffix : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): InnerOp { - const message = { ...baseInnerOp } as InnerOp; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = 0; - } - if (object.prefix !== undefined && object.prefix !== null) { - message.prefix = object.prefix; - } else { - message.prefix = new Uint8Array(); - } - if (object.suffix !== undefined && object.suffix !== null) { - message.suffix = object.suffix; - } else { - message.suffix = new Uint8Array(); - } - return message; - }, -}; - -const baseProofSpec: object = { max_depth: 0, min_depth: 0 }; - -export const ProofSpec = { - encode(message: ProofSpec, writer: Writer = Writer.create()): Writer { - if (message.leaf_spec !== undefined) { - LeafOp.encode(message.leaf_spec, writer.uint32(10).fork()).ldelim(); - } - if (message.inner_spec !== undefined) { - InnerSpec.encode(message.inner_spec, writer.uint32(18).fork()).ldelim(); - } - if (message.max_depth !== 0) { - writer.uint32(24).int32(message.max_depth); - } - if (message.min_depth !== 0) { - writer.uint32(32).int32(message.min_depth); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ProofSpec { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofSpec } as ProofSpec; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.leaf_spec = LeafOp.decode(reader, reader.uint32()); - break; - case 2: - message.inner_spec = InnerSpec.decode(reader, reader.uint32()); - break; - case 3: - message.max_depth = reader.int32(); - break; - case 4: - message.min_depth = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ProofSpec { - const message = { ...baseProofSpec } as ProofSpec; - if (object.leaf_spec !== undefined && object.leaf_spec !== null) { - message.leaf_spec = LeafOp.fromJSON(object.leaf_spec); - } else { - message.leaf_spec = undefined; - } - if (object.inner_spec !== undefined && object.inner_spec !== null) { - message.inner_spec = InnerSpec.fromJSON(object.inner_spec); - } else { - message.inner_spec = undefined; - } - if (object.max_depth !== undefined && object.max_depth !== null) { - message.max_depth = Number(object.max_depth); - } else { - message.max_depth = 0; - } - if (object.min_depth !== undefined && object.min_depth !== null) { - message.min_depth = Number(object.min_depth); - } else { - message.min_depth = 0; - } - return message; - }, - - toJSON(message: ProofSpec): unknown { - const obj: any = {}; - message.leaf_spec !== undefined && - (obj.leaf_spec = message.leaf_spec - ? LeafOp.toJSON(message.leaf_spec) - : undefined); - message.inner_spec !== undefined && - (obj.inner_spec = message.inner_spec - ? InnerSpec.toJSON(message.inner_spec) - : undefined); - message.max_depth !== undefined && (obj.max_depth = message.max_depth); - message.min_depth !== undefined && (obj.min_depth = message.min_depth); - return obj; - }, - - fromPartial(object: DeepPartial): ProofSpec { - const message = { ...baseProofSpec } as ProofSpec; - if (object.leaf_spec !== undefined && object.leaf_spec !== null) { - message.leaf_spec = LeafOp.fromPartial(object.leaf_spec); - } else { - message.leaf_spec = undefined; - } - if (object.inner_spec !== undefined && object.inner_spec !== null) { - message.inner_spec = InnerSpec.fromPartial(object.inner_spec); - } else { - message.inner_spec = undefined; - } - if (object.max_depth !== undefined && object.max_depth !== null) { - message.max_depth = object.max_depth; - } else { - message.max_depth = 0; - } - if (object.min_depth !== undefined && object.min_depth !== null) { - message.min_depth = object.min_depth; - } else { - message.min_depth = 0; - } - return message; - }, -}; - -const baseInnerSpec: object = { - child_order: 0, - child_size: 0, - min_prefix_length: 0, - max_prefix_length: 0, - hash: 0, -}; - -export const InnerSpec = { - encode(message: InnerSpec, writer: Writer = Writer.create()): Writer { - writer.uint32(10).fork(); - for (const v of message.child_order) { - writer.int32(v); - } - writer.ldelim(); - if (message.child_size !== 0) { - writer.uint32(16).int32(message.child_size); - } - if (message.min_prefix_length !== 0) { - writer.uint32(24).int32(message.min_prefix_length); - } - if (message.max_prefix_length !== 0) { - writer.uint32(32).int32(message.max_prefix_length); - } - if (message.empty_child.length !== 0) { - writer.uint32(42).bytes(message.empty_child); - } - if (message.hash !== 0) { - writer.uint32(48).int32(message.hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): InnerSpec { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseInnerSpec } as InnerSpec; - message.child_order = []; - 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.child_order.push(reader.int32()); - } - } else { - message.child_order.push(reader.int32()); - } - break; - case 2: - message.child_size = reader.int32(); - break; - case 3: - message.min_prefix_length = reader.int32(); - break; - case 4: - message.max_prefix_length = reader.int32(); - break; - case 5: - message.empty_child = reader.bytes(); - break; - case 6: - message.hash = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): InnerSpec { - const message = { ...baseInnerSpec } as InnerSpec; - message.child_order = []; - if (object.child_order !== undefined && object.child_order !== null) { - for (const e of object.child_order) { - message.child_order.push(Number(e)); - } - } - if (object.child_size !== undefined && object.child_size !== null) { - message.child_size = Number(object.child_size); - } else { - message.child_size = 0; - } - if ( - object.min_prefix_length !== undefined && - object.min_prefix_length !== null - ) { - message.min_prefix_length = Number(object.min_prefix_length); - } else { - message.min_prefix_length = 0; - } - if ( - object.max_prefix_length !== undefined && - object.max_prefix_length !== null - ) { - message.max_prefix_length = Number(object.max_prefix_length); - } else { - message.max_prefix_length = 0; - } - if (object.empty_child !== undefined && object.empty_child !== null) { - message.empty_child = bytesFromBase64(object.empty_child); - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = hashOpFromJSON(object.hash); - } else { - message.hash = 0; - } - return message; - }, - - toJSON(message: InnerSpec): unknown { - const obj: any = {}; - if (message.child_order) { - obj.child_order = message.child_order.map((e) => e); - } else { - obj.child_order = []; - } - message.child_size !== undefined && (obj.child_size = message.child_size); - message.min_prefix_length !== undefined && - (obj.min_prefix_length = message.min_prefix_length); - message.max_prefix_length !== undefined && - (obj.max_prefix_length = message.max_prefix_length); - message.empty_child !== undefined && - (obj.empty_child = base64FromBytes( - message.empty_child !== undefined - ? message.empty_child - : new Uint8Array() - )); - message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); - return obj; - }, - - fromPartial(object: DeepPartial): InnerSpec { - const message = { ...baseInnerSpec } as InnerSpec; - message.child_order = []; - if (object.child_order !== undefined && object.child_order !== null) { - for (const e of object.child_order) { - message.child_order.push(e); - } - } - if (object.child_size !== undefined && object.child_size !== null) { - message.child_size = object.child_size; - } else { - message.child_size = 0; - } - if ( - object.min_prefix_length !== undefined && - object.min_prefix_length !== null - ) { - message.min_prefix_length = object.min_prefix_length; - } else { - message.min_prefix_length = 0; - } - if ( - object.max_prefix_length !== undefined && - object.max_prefix_length !== null - ) { - message.max_prefix_length = object.max_prefix_length; - } else { - message.max_prefix_length = 0; - } - if (object.empty_child !== undefined && object.empty_child !== null) { - message.empty_child = object.empty_child; - } else { - message.empty_child = new Uint8Array(); - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = 0; - } - return message; - }, -}; - -const baseBatchProof: object = {}; - -export const BatchProof = { - encode(message: BatchProof, writer: Writer = Writer.create()): Writer { - for (const v of message.entries) { - BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BatchProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBatchProof } as BatchProof; - message.entries = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.entries.push(BatchEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BatchProof { - const message = { ...baseBatchProof } as BatchProof; - message.entries = []; - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(BatchEntry.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: BatchProof): unknown { - const obj: any = {}; - if (message.entries) { - obj.entries = message.entries.map((e) => - e ? BatchEntry.toJSON(e) : undefined - ); - } else { - obj.entries = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): BatchProof { - const message = { ...baseBatchProof } as BatchProof; - message.entries = []; - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(BatchEntry.fromPartial(e)); - } - } - return message; - }, -}; - -const baseBatchEntry: object = {}; - -export const BatchEntry = { - encode(message: BatchEntry, writer: Writer = Writer.create()): Writer { - if (message.exist !== undefined) { - ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); - } - if (message.nonexist !== undefined) { - NonExistenceProof.encode( - message.nonexist, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): BatchEntry { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBatchEntry } as BatchEntry; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exist = ExistenceProof.decode(reader, reader.uint32()); - break; - case 2: - message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): BatchEntry { - const message = { ...baseBatchEntry } as BatchEntry; - if (object.exist !== undefined && object.exist !== null) { - message.exist = ExistenceProof.fromJSON(object.exist); - } else { - message.exist = undefined; - } - if (object.nonexist !== undefined && object.nonexist !== null) { - message.nonexist = NonExistenceProof.fromJSON(object.nonexist); - } else { - message.nonexist = undefined; - } - return message; - }, - - toJSON(message: BatchEntry): unknown { - const obj: any = {}; - message.exist !== undefined && - (obj.exist = message.exist - ? ExistenceProof.toJSON(message.exist) - : undefined); - message.nonexist !== undefined && - (obj.nonexist = message.nonexist - ? NonExistenceProof.toJSON(message.nonexist) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): BatchEntry { - const message = { ...baseBatchEntry } as BatchEntry; - if (object.exist !== undefined && object.exist !== null) { - message.exist = ExistenceProof.fromPartial(object.exist); - } else { - message.exist = undefined; - } - if (object.nonexist !== undefined && object.nonexist !== null) { - message.nonexist = NonExistenceProof.fromPartial(object.nonexist); - } else { - message.nonexist = undefined; - } - return message; - }, -}; - -const baseCompressedBatchProof: object = {}; - -export const CompressedBatchProof = { - encode( - message: CompressedBatchProof, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.entries) { - CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.lookup_inners) { - InnerOp.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CompressedBatchProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCompressedBatchProof } as CompressedBatchProof; - message.entries = []; - message.lookup_inners = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.entries.push( - CompressedBatchEntry.decode(reader, reader.uint32()) - ); - break; - case 2: - message.lookup_inners.push(InnerOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CompressedBatchProof { - const message = { ...baseCompressedBatchProof } as CompressedBatchProof; - message.entries = []; - message.lookup_inners = []; - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(CompressedBatchEntry.fromJSON(e)); - } - } - if (object.lookup_inners !== undefined && object.lookup_inners !== null) { - for (const e of object.lookup_inners) { - message.lookup_inners.push(InnerOp.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: CompressedBatchProof): unknown { - const obj: any = {}; - if (message.entries) { - obj.entries = message.entries.map((e) => - e ? CompressedBatchEntry.toJSON(e) : undefined - ); - } else { - obj.entries = []; - } - if (message.lookup_inners) { - obj.lookup_inners = message.lookup_inners.map((e) => - e ? InnerOp.toJSON(e) : undefined - ); - } else { - obj.lookup_inners = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): CompressedBatchProof { - const message = { ...baseCompressedBatchProof } as CompressedBatchProof; - message.entries = []; - message.lookup_inners = []; - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(CompressedBatchEntry.fromPartial(e)); - } - } - if (object.lookup_inners !== undefined && object.lookup_inners !== null) { - for (const e of object.lookup_inners) { - message.lookup_inners.push(InnerOp.fromPartial(e)); - } - } - return message; - }, -}; - -const baseCompressedBatchEntry: object = {}; - -export const CompressedBatchEntry = { - encode( - message: CompressedBatchEntry, - writer: Writer = Writer.create() - ): Writer { - if (message.exist !== undefined) { - CompressedExistenceProof.encode( - message.exist, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.nonexist !== undefined) { - CompressedNonExistenceProof.encode( - message.nonexist, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): CompressedBatchEntry { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exist = CompressedExistenceProof.decode( - reader, - reader.uint32() - ); - break; - case 2: - message.nonexist = CompressedNonExistenceProof.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CompressedBatchEntry { - const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; - if (object.exist !== undefined && object.exist !== null) { - message.exist = CompressedExistenceProof.fromJSON(object.exist); - } else { - message.exist = undefined; - } - if (object.nonexist !== undefined && object.nonexist !== null) { - message.nonexist = CompressedNonExistenceProof.fromJSON(object.nonexist); - } else { - message.nonexist = undefined; - } - return message; - }, - - toJSON(message: CompressedBatchEntry): unknown { - const obj: any = {}; - message.exist !== undefined && - (obj.exist = message.exist - ? CompressedExistenceProof.toJSON(message.exist) - : undefined); - message.nonexist !== undefined && - (obj.nonexist = message.nonexist - ? CompressedNonExistenceProof.toJSON(message.nonexist) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): CompressedBatchEntry { - const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; - if (object.exist !== undefined && object.exist !== null) { - message.exist = CompressedExistenceProof.fromPartial(object.exist); - } else { - message.exist = undefined; - } - if (object.nonexist !== undefined && object.nonexist !== null) { - message.nonexist = CompressedNonExistenceProof.fromPartial( - object.nonexist - ); - } else { - message.nonexist = undefined; - } - return message; - }, -}; - -const baseCompressedExistenceProof: object = { path: 0 }; - -export const CompressedExistenceProof = { - encode( - message: CompressedExistenceProof, - writer: Writer = Writer.create() - ): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - if (message.leaf !== undefined) { - LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); - } - writer.uint32(34).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CompressedExistenceProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCompressedExistenceProof, - } as CompressedExistenceProof; - message.path = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - case 3: - message.leaf = LeafOp.decode(reader, reader.uint32()); - break; - case 4: - 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; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CompressedExistenceProof { - const message = { - ...baseCompressedExistenceProof, - } as CompressedExistenceProof; - message.path = []; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - if (object.leaf !== undefined && object.leaf !== null) { - message.leaf = LeafOp.fromJSON(object.leaf); - } else { - message.leaf = undefined; - } - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - return message; - }, - - toJSON(message: CompressedExistenceProof): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - message.leaf !== undefined && - (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): CompressedExistenceProof { - const message = { - ...baseCompressedExistenceProof, - } as CompressedExistenceProof; - message.path = []; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - if (object.leaf !== undefined && object.leaf !== null) { - message.leaf = LeafOp.fromPartial(object.leaf); - } else { - message.leaf = undefined; - } - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - return message; - }, -}; - -const baseCompressedNonExistenceProof: object = {}; - -export const CompressedNonExistenceProof = { - encode( - message: CompressedNonExistenceProof, - writer: Writer = Writer.create() - ): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.left !== undefined) { - CompressedExistenceProof.encode( - message.left, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.right !== undefined) { - CompressedExistenceProof.encode( - message.right, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CompressedNonExistenceProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCompressedNonExistenceProof, - } as CompressedNonExistenceProof; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.left = CompressedExistenceProof.decode( - reader, - reader.uint32() - ); - break; - case 3: - message.right = CompressedExistenceProof.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CompressedNonExistenceProof { - const message = { - ...baseCompressedNonExistenceProof, - } as CompressedNonExistenceProof; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.left !== undefined && object.left !== null) { - message.left = CompressedExistenceProof.fromJSON(object.left); - } else { - message.left = undefined; - } - if (object.right !== undefined && object.right !== null) { - message.right = CompressedExistenceProof.fromJSON(object.right); - } else { - message.right = undefined; - } - return message; - }, - - toJSON(message: CompressedNonExistenceProof): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.left !== undefined && - (obj.left = message.left - ? CompressedExistenceProof.toJSON(message.left) - : undefined); - message.right !== undefined && - (obj.right = message.right - ? CompressedExistenceProof.toJSON(message.right) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): CompressedNonExistenceProof { - const message = { - ...baseCompressedNonExistenceProof, - } as CompressedNonExistenceProof; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.left !== undefined && object.left !== null) { - message.left = CompressedExistenceProof.fromPartial(object.left); - } else { - message.left = undefined; - } - if (object.right !== undefined && object.right !== null) { - message.right = CompressedExistenceProof.fromPartial(object.right); - } else { - message.right = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/package.json b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/package.json deleted file mode 100644 index 28ee9802..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "ibc-core-connection-v1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module ibc.core.connection.v1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/ibc-go/v2/modules/core/03-connection/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/vuex-root b/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.connection.v1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/index.ts deleted file mode 100644 index c1d7d3b9..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/index.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { txClient, queryClient, MissingWalletError , registry} from './module' - - - -export { }; - -async function initTxClient(vuexGetters) { - return await txClient(vuexGetters['common/wallet/signer'], { - addr: vuexGetters['common/env/apiTendermint'] - }) -} - -async function initQueryClient(vuexGetters) { - return await queryClient({ - addr: vuexGetters['common/env/apiCosmos'] - }) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -function getStructure(template) { - let structure = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field: any = {} - field.name = key - field.type = typeof value - structure.fields.push(field) - } - return structure -} - -const getDefaultState = () => { - return { - - _Structure: { - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.core.port.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - } -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/index.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/index.ts deleted file mode 100644 index 67d4b093..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/rest.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/rest.ts deleted file mode 100644 index b1008d09..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/rest.ts +++ /dev/null @@ -1,357 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** -* `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 := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(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 ProtobufAny { - /** - * 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. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -export interface V1Counterparty { - /** port on the counterparty chain which owns the other end of the channel. */ - port_id?: string; - channel_id?: string; -} - -/** -* - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in -which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent -*/ -export enum V1Order { - ORDER_NONE_UNSPECIFIED = "ORDER_NONE_UNSPECIFIED", - ORDER_UNORDERED = "ORDER_UNORDERED", - ORDER_ORDERED = "ORDER_ORDERED", -} - -/** - * QueryAppVersionResponse is the response type for the Query/AppVersion RPC method. - */ -export interface V1QueryAppVersionResponse { - port_id?: string; - version?: string; -} - -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; - -export interface FullRequestParams extends Omit { - /** set parameter to `true` for call `securityWorker` for this request */ - secure?: boolean; - /** request path */ - path: string; - /** content type of request body */ - type?: ContentType; - /** query params */ - query?: QueryParamsType; - /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; - /** request body */ - body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; -} - -export type RequestParams = Omit; - -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; -} - -type CancelToken = Symbol | string | number; - -export enum ContentType { - Json = "application/json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", -} - -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } - - public setSecurityData = (data: SecurityDataType) => { - this.securityData = data; - }; - - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } - - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - - public request = ({ - body, - secure, - path, - type, - query, - format = "json", - baseUrl, - cancelToken, - ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; - }); - }; -} - -/** - * @title ibc/core/port/v1/query.proto - * @version version not set - */ -export class Api extends HttpClient {} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts deleted file mode 100644 index e9cefea2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/cosmos/upgrade/v1beta1/upgrade.ts +++ /dev/null @@ -1,414 +0,0 @@ -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "cosmos.upgrade.v1beta1"; - -/** Plan specifies information about a planned upgrade and when it should occur. */ -export interface Plan { - /** - * Sets the name for the upgrade. This name will be used by the upgraded - * version of the software to apply any special "on-upgrade" commands during - * the first BeginBlock method after the upgrade is applied. It is also used - * to detect whether a software version can handle a given upgrade. If no - * upgrade handler with this name has been set in the software, it will be - * assumed that the software is out-of-date when the upgrade Time or Height is - * reached and the software will exit. - */ - name: string; - /** - * The time after which the upgrade must be performed. - * Leave set to its zero value to use a pre-defined Height instead. - */ - time: Date | undefined; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ - height: number; - /** - * Any application specific upgrade info to be included on-chain - * such as a git commit that validators could automatically upgrade to - */ - info: string; -} - -/** - * SoftwareUpgradeProposal is a gov Content type for initiating a software - * upgrade. - */ -export interface SoftwareUpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; -} - -/** - * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software - * upgrade. - */ -export interface CancelSoftwareUpgradeProposal { - title: string; - description: string; -} - -const basePlan: object = { name: "", height: 0, info: "" }; - -export const Plan = { - encode(message: Plan, writer: Writer = Writer.create()): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePlan } as Plan; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - return message; - }, - - toJSON(message: Plan): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.height !== undefined && (obj.height = message.height); - message.info !== undefined && (obj.info = message.info); - return obj; - }, - - fromPartial(object: DeepPartial): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - return message; - }, -}; - -const baseSoftwareUpgradeProposal: object = { title: "", description: "" }; - -export const SoftwareUpgradeProposal = { - encode( - message: SoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - return message; - }, - - toJSON(message: SoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - return message; - }, -}; - -const baseCancelSoftwareUpgradeProposal: object = { - title: "", - description: "", -}; - -export const CancelSoftwareUpgradeProposal = { - encode( - message: CancelSoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): CancelSoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - return message; - }, - - toJSON(message: CancelSoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - return obj; - }, - - fromPartial( - object: DeepPartial - ): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/gogoproto/gogo.ts deleted file mode 100644 index 3f41a047..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/google/protobuf/any.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/google/protobuf/any.ts deleted file mode 100644 index 233eae46..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/google/protobuf/any.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* eslint-disable */ -import { Writer, Reader } 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 := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(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 { - /** - * 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. - */ - type_url: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -const baseAny: object = { type_url: "" }; - -export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/google/protobuf/descriptor.ts deleted file mode 100644 index a0167cb2..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5314 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface 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 { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface 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). - */ - type_name: 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? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: boolean; -} - -export interface 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -export interface 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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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 { - 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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 { - name_part: string; - is_extension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface 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 { - /** - * 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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 { - /** - * 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 { - /** - * 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/google/protobuf/timestamp.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/google/protobuf/timestamp.ts deleted file mode 100644 index 11864afc..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -const baseTimestamp: object = { seconds: 0, nanos: 0 }; - -export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTimestamp } as Timestamp; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = longToNumber(reader.int64() as Long); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/ibc/core/channel/v1/channel.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/ibc/core/channel/v1/channel.ts deleted file mode 100644 index 7ce43306..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/ibc/core/channel/v1/channel.ts +++ /dev/null @@ -1,1073 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Height } from "../../../../ibc/core/client/v1/client"; - -export const protobufPackage = "ibc.core.channel.v1"; - -/** - * State defines if a channel is in one of the following states: - * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - */ -export enum State { - /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ - STATE_UNINITIALIZED_UNSPECIFIED = 0, - /** STATE_INIT - A channel has just started the opening handshake. */ - STATE_INIT = 1, - /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */ - STATE_TRYOPEN = 2, - /** - * STATE_OPEN - A channel has completed the handshake. Open channels are - * ready to send and receive packets. - */ - STATE_OPEN = 3, - /** - * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive - * packets. - */ - STATE_CLOSED = 4, - UNRECOGNIZED = -1, -} - -export function stateFromJSON(object: any): State { - switch (object) { - case 0: - case "STATE_UNINITIALIZED_UNSPECIFIED": - return State.STATE_UNINITIALIZED_UNSPECIFIED; - case 1: - case "STATE_INIT": - return State.STATE_INIT; - case 2: - case "STATE_TRYOPEN": - return State.STATE_TRYOPEN; - case 3: - case "STATE_OPEN": - return State.STATE_OPEN; - case 4: - case "STATE_CLOSED": - return State.STATE_CLOSED; - case -1: - case "UNRECOGNIZED": - default: - return State.UNRECOGNIZED; - } -} - -export function stateToJSON(object: State): string { - switch (object) { - case State.STATE_UNINITIALIZED_UNSPECIFIED: - return "STATE_UNINITIALIZED_UNSPECIFIED"; - case State.STATE_INIT: - return "STATE_INIT"; - case State.STATE_TRYOPEN: - return "STATE_TRYOPEN"; - case State.STATE_OPEN: - return "STATE_OPEN"; - case State.STATE_CLOSED: - return "STATE_CLOSED"; - default: - return "UNKNOWN"; - } -} - -/** Order defines if a channel is ORDERED or UNORDERED */ -export enum Order { - /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */ - ORDER_NONE_UNSPECIFIED = 0, - /** - * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in - * which they were sent. - */ - ORDER_UNORDERED = 1, - /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */ - ORDER_ORDERED = 2, - UNRECOGNIZED = -1, -} - -export function orderFromJSON(object: any): Order { - switch (object) { - case 0: - case "ORDER_NONE_UNSPECIFIED": - return Order.ORDER_NONE_UNSPECIFIED; - case 1: - case "ORDER_UNORDERED": - return Order.ORDER_UNORDERED; - case 2: - case "ORDER_ORDERED": - return Order.ORDER_ORDERED; - case -1: - case "UNRECOGNIZED": - default: - return Order.UNRECOGNIZED; - } -} - -export function orderToJSON(object: Order): string { - switch (object) { - case Order.ORDER_NONE_UNSPECIFIED: - return "ORDER_NONE_UNSPECIFIED"; - case Order.ORDER_UNORDERED: - return "ORDER_UNORDERED"; - case Order.ORDER_ORDERED: - return "ORDER_ORDERED"; - default: - return "UNKNOWN"; - } -} - -/** - * Channel defines pipeline for exactly-once packet delivery between specific - * modules on separate blockchains, which has at least one end capable of - * sending packets and one end capable of receiving packets. - */ -export interface Channel { - /** current state of the channel end */ - state: State; - /** whether the channel is ordered or unordered */ - ordering: Order; - /** counterparty channel end */ - counterparty: Counterparty | undefined; - /** - * list of connection identifiers, in order, along which packets sent on - * this channel will travel - */ - connection_hops: string[]; - /** opaque channel version, which is agreed upon during the handshake */ - version: string; -} - -/** - * IdentifiedChannel defines a channel with additional port and channel - * identifier fields. - */ -export interface IdentifiedChannel { - /** current state of the channel end */ - state: State; - /** whether the channel is ordered or unordered */ - ordering: Order; - /** counterparty channel end */ - counterparty: Counterparty | undefined; - /** - * list of connection identifiers, in order, along which packets sent on - * this channel will travel - */ - connection_hops: string[]; - /** opaque channel version, which is agreed upon during the handshake */ - version: string; - /** port identifier */ - port_id: string; - /** channel identifier */ - channel_id: string; -} - -/** Counterparty defines a channel end counterparty */ -export interface Counterparty { - /** port on the counterparty chain which owns the other end of the channel. */ - port_id: string; - /** channel end on the counterparty chain */ - channel_id: string; -} - -/** Packet defines a type that carries data across different chains through IBC */ -export interface Packet { - /** - * number corresponds to the order of sends and receives, where a Packet - * with an earlier sequence number must be sent and received before a Packet - * with a later sequence number. - */ - sequence: number; - /** identifies the port on the sending chain. */ - source_port: string; - /** identifies the channel end on the sending chain. */ - source_channel: string; - /** identifies the port on the receiving chain. */ - destination_port: string; - /** identifies the channel end on the receiving chain. */ - destination_channel: string; - /** actual opaque bytes transferred directly to the application module */ - data: Uint8Array; - /** block height after which the packet times out */ - timeout_height: Height | undefined; - /** block timestamp (in nanoseconds) after which the packet times out */ - timeout_timestamp: number; -} - -/** - * PacketState defines the generic type necessary to retrieve and store - * packet commitments, acknowledgements, and receipts. - * Caller is responsible for knowing the context necessary to interpret this - * state as a commitment, acknowledgement, or a receipt. - */ -export interface PacketState { - /** channel port identifier. */ - port_id: string; - /** channel unique identifier. */ - channel_id: string; - /** packet sequence. */ - sequence: number; - /** embedded data that represents packet state. */ - data: Uint8Array; -} - -/** - * Acknowledgement is the recommended acknowledgement format to be used by - * app-specific protocols. - * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental - * conflicts with other protobuf message formats used for acknowledgements. - * The first byte of any message with this format will be the non-ASCII values - * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: - * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope - */ -export interface Acknowledgement { - result: Uint8Array | undefined; - error: string | undefined; -} - -const baseChannel: object = { - state: 0, - ordering: 0, - connection_hops: "", - version: "", -}; - -export const Channel = { - encode(message: Channel, writer: Writer = Writer.create()): Writer { - if (message.state !== 0) { - writer.uint32(8).int32(message.state); - } - if (message.ordering !== 0) { - writer.uint32(16).int32(message.ordering); - } - if (message.counterparty !== undefined) { - Counterparty.encode( - message.counterparty, - writer.uint32(26).fork() - ).ldelim(); - } - for (const v of message.connection_hops) { - writer.uint32(34).string(v!); - } - if (message.version !== "") { - writer.uint32(42).string(message.version); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Channel { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseChannel } as Channel; - message.connection_hops = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32() as any; - break; - case 2: - message.ordering = reader.int32() as any; - break; - case 3: - message.counterparty = Counterparty.decode(reader, reader.uint32()); - break; - case 4: - message.connection_hops.push(reader.string()); - break; - case 5: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Channel { - const message = { ...baseChannel } as Channel; - message.connection_hops = []; - if (object.state !== undefined && object.state !== null) { - message.state = stateFromJSON(object.state); - } else { - message.state = 0; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = orderFromJSON(object.ordering); - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromJSON(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.connection_hops !== undefined && - object.connection_hops !== null - ) { - for (const e of object.connection_hops) { - message.connection_hops.push(String(e)); - } - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - return message; - }, - - toJSON(message: Channel): unknown { - const obj: any = {}; - message.state !== undefined && (obj.state = stateToJSON(message.state)); - message.ordering !== undefined && - (obj.ordering = orderToJSON(message.ordering)); - message.counterparty !== undefined && - (obj.counterparty = message.counterparty - ? Counterparty.toJSON(message.counterparty) - : undefined); - if (message.connection_hops) { - obj.connection_hops = message.connection_hops.map((e) => e); - } else { - obj.connection_hops = []; - } - message.version !== undefined && (obj.version = message.version); - return obj; - }, - - fromPartial(object: DeepPartial): Channel { - const message = { ...baseChannel } as Channel; - message.connection_hops = []; - if (object.state !== undefined && object.state !== null) { - message.state = object.state; - } else { - message.state = 0; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = object.ordering; - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromPartial(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.connection_hops !== undefined && - object.connection_hops !== null - ) { - for (const e of object.connection_hops) { - message.connection_hops.push(e); - } - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - return message; - }, -}; - -const baseIdentifiedChannel: object = { - state: 0, - ordering: 0, - connection_hops: "", - version: "", - port_id: "", - channel_id: "", -}; - -export const IdentifiedChannel = { - encode(message: IdentifiedChannel, writer: Writer = Writer.create()): Writer { - if (message.state !== 0) { - writer.uint32(8).int32(message.state); - } - if (message.ordering !== 0) { - writer.uint32(16).int32(message.ordering); - } - if (message.counterparty !== undefined) { - Counterparty.encode( - message.counterparty, - writer.uint32(26).fork() - ).ldelim(); - } - for (const v of message.connection_hops) { - writer.uint32(34).string(v!); - } - if (message.version !== "") { - writer.uint32(42).string(message.version); - } - if (message.port_id !== "") { - writer.uint32(50).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(58).string(message.channel_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IdentifiedChannel { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIdentifiedChannel } as IdentifiedChannel; - message.connection_hops = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32() as any; - break; - case 2: - message.ordering = reader.int32() as any; - break; - case 3: - message.counterparty = Counterparty.decode(reader, reader.uint32()); - break; - case 4: - message.connection_hops.push(reader.string()); - break; - case 5: - message.version = reader.string(); - break; - case 6: - message.port_id = reader.string(); - break; - case 7: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IdentifiedChannel { - const message = { ...baseIdentifiedChannel } as IdentifiedChannel; - message.connection_hops = []; - if (object.state !== undefined && object.state !== null) { - message.state = stateFromJSON(object.state); - } else { - message.state = 0; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = orderFromJSON(object.ordering); - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromJSON(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.connection_hops !== undefined && - object.connection_hops !== null - ) { - for (const e of object.connection_hops) { - message.connection_hops.push(String(e)); - } - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - return message; - }, - - toJSON(message: IdentifiedChannel): unknown { - const obj: any = {}; - message.state !== undefined && (obj.state = stateToJSON(message.state)); - message.ordering !== undefined && - (obj.ordering = orderToJSON(message.ordering)); - message.counterparty !== undefined && - (obj.counterparty = message.counterparty - ? Counterparty.toJSON(message.counterparty) - : undefined); - if (message.connection_hops) { - obj.connection_hops = message.connection_hops.map((e) => e); - } else { - obj.connection_hops = []; - } - message.version !== undefined && (obj.version = message.version); - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - return obj; - }, - - fromPartial(object: DeepPartial): IdentifiedChannel { - const message = { ...baseIdentifiedChannel } as IdentifiedChannel; - message.connection_hops = []; - if (object.state !== undefined && object.state !== null) { - message.state = object.state; - } else { - message.state = 0; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = object.ordering; - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromPartial(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.connection_hops !== undefined && - object.connection_hops !== null - ) { - for (const e of object.connection_hops) { - message.connection_hops.push(e); - } - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - return message; - }, -}; - -const baseCounterparty: object = { port_id: "", channel_id: "" }; - -export const Counterparty = { - encode(message: Counterparty, writer: Writer = Writer.create()): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Counterparty { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCounterparty } as Counterparty; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Counterparty { - const message = { ...baseCounterparty } as Counterparty; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - return message; - }, - - toJSON(message: Counterparty): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - return obj; - }, - - fromPartial(object: DeepPartial): Counterparty { - const message = { ...baseCounterparty } as Counterparty; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - return message; - }, -}; - -const basePacket: object = { - sequence: 0, - source_port: "", - source_channel: "", - destination_port: "", - destination_channel: "", - timeout_timestamp: 0, -}; - -export const Packet = { - encode(message: Packet, writer: Writer = Writer.create()): Writer { - if (message.sequence !== 0) { - writer.uint32(8).uint64(message.sequence); - } - if (message.source_port !== "") { - writer.uint32(18).string(message.source_port); - } - if (message.source_channel !== "") { - writer.uint32(26).string(message.source_channel); - } - if (message.destination_port !== "") { - writer.uint32(34).string(message.destination_port); - } - if (message.destination_channel !== "") { - writer.uint32(42).string(message.destination_channel); - } - if (message.data.length !== 0) { - writer.uint32(50).bytes(message.data); - } - if (message.timeout_height !== undefined) { - Height.encode(message.timeout_height, writer.uint32(58).fork()).ldelim(); - } - if (message.timeout_timestamp !== 0) { - writer.uint32(64).uint64(message.timeout_timestamp); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Packet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePacket } as Packet; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = longToNumber(reader.uint64() as Long); - break; - case 2: - message.source_port = reader.string(); - break; - case 3: - message.source_channel = reader.string(); - break; - case 4: - message.destination_port = reader.string(); - break; - case 5: - message.destination_channel = reader.string(); - break; - case 6: - message.data = reader.bytes(); - break; - case 7: - message.timeout_height = Height.decode(reader, reader.uint32()); - break; - case 8: - message.timeout_timestamp = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Packet { - const message = { ...basePacket } as Packet; - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - if (object.source_port !== undefined && object.source_port !== null) { - message.source_port = String(object.source_port); - } else { - message.source_port = ""; - } - if (object.source_channel !== undefined && object.source_channel !== null) { - message.source_channel = String(object.source_channel); - } else { - message.source_channel = ""; - } - if ( - object.destination_port !== undefined && - object.destination_port !== null - ) { - message.destination_port = String(object.destination_port); - } else { - message.destination_port = ""; - } - if ( - object.destination_channel !== undefined && - object.destination_channel !== null - ) { - message.destination_channel = String(object.destination_channel); - } else { - message.destination_channel = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = Height.fromJSON(object.timeout_height); - } else { - message.timeout_height = undefined; - } - if ( - object.timeout_timestamp !== undefined && - object.timeout_timestamp !== null - ) { - message.timeout_timestamp = Number(object.timeout_timestamp); - } else { - message.timeout_timestamp = 0; - } - return message; - }, - - toJSON(message: Packet): unknown { - const obj: any = {}; - message.sequence !== undefined && (obj.sequence = message.sequence); - message.source_port !== undefined && - (obj.source_port = message.source_port); - message.source_channel !== undefined && - (obj.source_channel = message.source_channel); - message.destination_port !== undefined && - (obj.destination_port = message.destination_port); - message.destination_channel !== undefined && - (obj.destination_channel = message.destination_channel); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.timeout_height !== undefined && - (obj.timeout_height = message.timeout_height - ? Height.toJSON(message.timeout_height) - : undefined); - message.timeout_timestamp !== undefined && - (obj.timeout_timestamp = message.timeout_timestamp); - return obj; - }, - - fromPartial(object: DeepPartial): Packet { - const message = { ...basePacket } as Packet; - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - if (object.source_port !== undefined && object.source_port !== null) { - message.source_port = object.source_port; - } else { - message.source_port = ""; - } - if (object.source_channel !== undefined && object.source_channel !== null) { - message.source_channel = object.source_channel; - } else { - message.source_channel = ""; - } - if ( - object.destination_port !== undefined && - object.destination_port !== null - ) { - message.destination_port = object.destination_port; - } else { - message.destination_port = ""; - } - if ( - object.destination_channel !== undefined && - object.destination_channel !== null - ) { - message.destination_channel = object.destination_channel; - } else { - message.destination_channel = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = Height.fromPartial(object.timeout_height); - } else { - message.timeout_height = undefined; - } - if ( - object.timeout_timestamp !== undefined && - object.timeout_timestamp !== null - ) { - message.timeout_timestamp = object.timeout_timestamp; - } else { - message.timeout_timestamp = 0; - } - return message; - }, -}; - -const basePacketState: object = { port_id: "", channel_id: "", sequence: 0 }; - -export const PacketState = { - encode(message: PacketState, writer: Writer = Writer.create()): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.channel_id !== "") { - writer.uint32(18).string(message.channel_id); - } - if (message.sequence !== 0) { - writer.uint32(24).uint64(message.sequence); - } - if (message.data.length !== 0) { - writer.uint32(34).bytes(message.data); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PacketState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePacketState } as PacketState; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = longToNumber(reader.uint64() as Long); - break; - case 4: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PacketState { - const message = { ...basePacketState } as PacketState; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = String(object.channel_id); - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - toJSON(message: PacketState): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.channel_id !== undefined && (obj.channel_id = message.channel_id); - message.sequence !== undefined && (obj.sequence = message.sequence); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): PacketState { - const message = { ...basePacketState } as PacketState; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channel_id = object.channel_id; - } else { - message.channel_id = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, -}; - -const baseAcknowledgement: object = {}; - -export const Acknowledgement = { - encode(message: Acknowledgement, writer: Writer = Writer.create()): Writer { - if (message.result !== undefined) { - writer.uint32(170).bytes(message.result); - } - if (message.error !== undefined) { - writer.uint32(178).string(message.error); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Acknowledgement { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAcknowledgement } as Acknowledgement; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 21: - message.result = reader.bytes(); - break; - case 22: - message.error = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Acknowledgement { - const message = { ...baseAcknowledgement } as Acknowledgement; - if (object.result !== undefined && object.result !== null) { - message.result = bytesFromBase64(object.result); - } - if (object.error !== undefined && object.error !== null) { - message.error = String(object.error); - } else { - message.error = undefined; - } - return message; - }, - - toJSON(message: Acknowledgement): unknown { - const obj: any = {}; - message.result !== undefined && - (obj.result = - message.result !== undefined - ? base64FromBytes(message.result) - : undefined); - message.error !== undefined && (obj.error = message.error); - return obj; - }, - - fromPartial(object: DeepPartial): Acknowledgement { - const message = { ...baseAcknowledgement } as Acknowledgement; - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } else { - message.result = undefined; - } - if (object.error !== undefined && object.error !== null) { - message.error = object.error; - } else { - message.error = undefined; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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 (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/ibc/core/client/v1/client.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/ibc/core/client/v1/client.ts deleted file mode 100644 index b34686d3..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/ibc/core/client/v1/client.ts +++ /dev/null @@ -1,814 +0,0 @@ -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; - -export const protobufPackage = "ibc.core.client.v1"; - -/** - * IdentifiedClientState defines a client state with an additional client - * identifier field. - */ -export interface IdentifiedClientState { - /** client identifier */ - client_id: string; - /** client state */ - client_state: Any | undefined; -} - -/** - * ConsensusStateWithHeight defines a consensus state with an additional height - * field. - */ -export interface ConsensusStateWithHeight { - /** consensus state height */ - height: Height | undefined; - /** consensus state */ - consensus_state: Any | undefined; -} - -/** - * ClientConsensusStates defines all the stored consensus states for a given - * client. - */ -export interface ClientConsensusStates { - /** client identifier */ - client_id: string; - /** consensus states and their heights associated with the client */ - consensus_states: ConsensusStateWithHeight[]; -} - -/** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute - * client's latest consensus state is copied over to the subject client. The proposal - * handler may fail if the subject and the substitute do not match in client and - * chain parameters (with exception to latest height, frozen height, and chain-id). - */ -export interface ClientUpdateProposal { - /** the title of the update proposal */ - title: string; - /** the description of the proposal */ - description: string; - /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id: string; - /** - * the substitute client identifier for the client standing in for the subject - * client - */ - substitute_client_id: string; -} - -/** - * UpgradeProposal is a gov Content type for initiating an IBC breaking - * upgrade. - */ -export interface UpgradeProposal { - title: string; - description: string; - plan: Plan | undefined; - /** - * An UpgradedClientState must be provided to perform an IBC breaking upgrade. - * This will make the chain commit to the correct upgraded (self) client state - * before the upgrade occurs, so that connecting chains can verify that the - * new upgraded client is valid by verifying a proof on the previous version - * of the chain. This will allow IBC connections to persist smoothly across - * planned chain upgrades - */ - upgraded_client_state: Any | undefined; -} - -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface Height { - /** the revision that the client is currently on */ - revision_number: number; - /** the height within the given revision */ - revision_height: number; -} - -/** Params defines the set of IBC light client parameters. */ -export interface Params { - /** allowed_clients defines the list of allowed client state types. */ - allowed_clients: string[]; -} - -const baseIdentifiedClientState: object = { client_id: "" }; - -export const IdentifiedClientState = { - encode( - message: IdentifiedClientState, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - if (message.client_state !== undefined) { - Any.encode(message.client_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): IdentifiedClientState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromJSON(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, - - toJSON(message: IdentifiedClientState): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - message.client_state !== undefined && - (obj.client_state = message.client_state - ? Any.toJSON(message.client_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): IdentifiedClientState { - const message = { ...baseIdentifiedClientState } as IdentifiedClientState; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.client_state = Any.fromPartial(object.client_state); - } else { - message.client_state = undefined; - } - return message; - }, -}; - -const baseConsensusStateWithHeight: object = {}; - -export const ConsensusStateWithHeight = { - encode( - message: ConsensusStateWithHeight, - writer: Writer = Writer.create() - ): Writer { - if (message.height !== undefined) { - Height.encode(message.height, writer.uint32(10).fork()).ldelim(); - } - if (message.consensus_state !== undefined) { - Any.encode(message.consensus_state, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ConsensusStateWithHeight { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = Height.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromJSON(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromJSON(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, - - toJSON(message: ConsensusStateWithHeight): unknown { - const obj: any = {}; - message.height !== undefined && - (obj.height = message.height ? Height.toJSON(message.height) : undefined); - message.consensus_state !== undefined && - (obj.consensus_state = message.consensus_state - ? Any.toJSON(message.consensus_state) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ConsensusStateWithHeight { - const message = { - ...baseConsensusStateWithHeight, - } as ConsensusStateWithHeight; - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromPartial(object.height); - } else { - message.height = undefined; - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensus_state = Any.fromPartial(object.consensus_state); - } else { - message.consensus_state = undefined; - } - return message; - }, -}; - -const baseClientConsensusStates: object = { client_id: "" }; - -export const ClientConsensusStates = { - encode( - message: ClientConsensusStates, - writer: Writer = Writer.create() - ): Writer { - if (message.client_id !== "") { - writer.uint32(10).string(message.client_id); - } - for (const v of message.consensus_states) { - ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientConsensusStates { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.consensus_states.push( - ConsensusStateWithHeight.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = String(object.client_id); - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ClientConsensusStates): unknown { - const obj: any = {}; - message.client_id !== undefined && (obj.client_id = message.client_id); - if (message.consensus_states) { - obj.consensus_states = message.consensus_states.map((e) => - e ? ConsensusStateWithHeight.toJSON(e) : undefined - ); - } else { - obj.consensus_states = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ClientConsensusStates { - const message = { ...baseClientConsensusStates } as ClientConsensusStates; - message.consensus_states = []; - if (object.client_id !== undefined && object.client_id !== null) { - message.client_id = object.client_id; - } else { - message.client_id = ""; - } - if ( - object.consensus_states !== undefined && - object.consensus_states !== null - ) { - for (const e of object.consensus_states) { - message.consensus_states.push(ConsensusStateWithHeight.fromPartial(e)); - } - } - return message; - }, -}; - -const baseClientUpdateProposal: object = { - title: "", - description: "", - subject_client_id: "", - substitute_client_id: "", -}; - -export const ClientUpdateProposal = { - encode( - message: ClientUpdateProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.subject_client_id !== "") { - writer.uint32(26).string(message.subject_client_id); - } - if (message.substitute_client_id !== "") { - writer.uint32(34).string(message.substitute_client_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClientUpdateProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.subject_client_id = reader.string(); - break; - case 4: - message.substitute_client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = String(object.subject_client_id); - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = String(object.substitute_client_id); - } else { - message.substitute_client_id = ""; - } - return message; - }, - - toJSON(message: ClientUpdateProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.subject_client_id !== undefined && - (obj.subject_client_id = message.subject_client_id); - message.substitute_client_id !== undefined && - (obj.substitute_client_id = message.substitute_client_id); - return obj; - }, - - fromPartial(object: DeepPartial): ClientUpdateProposal { - const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subject_client_id = object.subject_client_id; - } else { - message.subject_client_id = ""; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substitute_client_id = object.substitute_client_id; - } else { - message.substitute_client_id = ""; - } - return message; - }, -}; - -const baseUpgradeProposal: object = { title: "", description: "" }; - -export const UpgradeProposal = { - encode(message: UpgradeProposal, writer: Writer = Writer.create()): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - if (message.upgraded_client_state !== undefined) { - Any.encode( - message.upgraded_client_state, - writer.uint32(34).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUpgradeProposal } as UpgradeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgraded_client_state = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromJSON( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, - - toJSON(message: UpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - message.upgraded_client_state !== undefined && - (obj.upgraded_client_state = message.upgraded_client_state - ? Any.toJSON(message.upgraded_client_state) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): UpgradeProposal { - const message = { ...baseUpgradeProposal } as UpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromPartial( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; - }, -}; - -const baseHeight: object = { revision_number: 0, revision_height: 0 }; - -export const Height = { - encode(message: Height, writer: Writer = Writer.create()): Writer { - if (message.revision_number !== 0) { - writer.uint32(8).uint64(message.revision_number); - } - if (message.revision_height !== 0) { - writer.uint32(16).uint64(message.revision_height); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Height { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeight } as Height; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revision_number = longToNumber(reader.uint64() as Long); - break; - case 2: - message.revision_height = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = Number(object.revision_number); - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = Number(object.revision_height); - } else { - message.revision_height = 0; - } - return message; - }, - - toJSON(message: Height): unknown { - const obj: any = {}; - message.revision_number !== undefined && - (obj.revision_number = message.revision_number); - message.revision_height !== undefined && - (obj.revision_height = message.revision_height); - return obj; - }, - - fromPartial(object: DeepPartial): Height { - const message = { ...baseHeight } as Height; - if ( - object.revision_number !== undefined && - object.revision_number !== null - ) { - message.revision_number = object.revision_number; - } else { - message.revision_number = 0; - } - if ( - object.revision_height !== undefined && - object.revision_height !== null - ) { - message.revision_height = object.revision_height; - } else { - message.revision_height = 0; - } - return message; - }, -}; - -const baseParams: object = { allowed_clients: "" }; - -export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - for (const v of message.allowed_clients) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - message.allowed_clients = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowed_clients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(String(e)); - } - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - if (message.allowed_clients) { - obj.allowed_clients = message.allowed_clients.map((e) => e); - } else { - obj.allowed_clients = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - message.allowed_clients = []; - if ( - object.allowed_clients !== undefined && - object.allowed_clients !== null - ) { - for (const e of object.allowed_clients) { - message.allowed_clients.push(e); - } - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/ibc/core/port/v1/query.ts b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/ibc/core/port/v1/query.ts deleted file mode 100644 index a0bebc39..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/module/types/ibc/core/port/v1/query.ts +++ /dev/null @@ -1,308 +0,0 @@ -/* eslint-disable */ -import { - Order, - Counterparty, - orderFromJSON, - orderToJSON, -} from "../../../../ibc/core/channel/v1/channel"; -import { Reader, Writer } from "protobufjs/minimal"; - -export const protobufPackage = "ibc.core.port.v1"; - -/** QueryAppVersionRequest is the request type for the Query/AppVersion RPC method */ -export interface QueryAppVersionRequest { - /** port unique identifier */ - port_id: string; - /** connection unique identifier */ - connection_id: string; - /** whether the channel is ordered or unordered */ - ordering: Order; - /** counterparty channel end */ - counterparty: Counterparty | undefined; - /** proposed version */ - proposed_version: string; -} - -/** QueryAppVersionResponse is the response type for the Query/AppVersion RPC method. */ -export interface QueryAppVersionResponse { - /** port id associated with the request identifiers */ - port_id: string; - /** supported app version */ - version: string; -} - -const baseQueryAppVersionRequest: object = { - port_id: "", - connection_id: "", - ordering: 0, - proposed_version: "", -}; - -export const QueryAppVersionRequest = { - encode( - message: QueryAppVersionRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.connection_id !== "") { - writer.uint32(18).string(message.connection_id); - } - if (message.ordering !== 0) { - writer.uint32(24).int32(message.ordering); - } - if (message.counterparty !== undefined) { - Counterparty.encode( - message.counterparty, - writer.uint32(34).fork() - ).ldelim(); - } - if (message.proposed_version !== "") { - writer.uint32(42).string(message.proposed_version); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAppVersionRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAppVersionRequest } as QueryAppVersionRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.connection_id = reader.string(); - break; - case 3: - message.ordering = reader.int32() as any; - break; - case 4: - message.counterparty = Counterparty.decode(reader, reader.uint32()); - break; - case 5: - message.proposed_version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAppVersionRequest { - const message = { ...baseQueryAppVersionRequest } as QueryAppVersionRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = String(object.connection_id); - } else { - message.connection_id = ""; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = orderFromJSON(object.ordering); - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromJSON(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.proposed_version !== undefined && - object.proposed_version !== null - ) { - message.proposed_version = String(object.proposed_version); - } else { - message.proposed_version = ""; - } - return message; - }, - - toJSON(message: QueryAppVersionRequest): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.connection_id !== undefined && - (obj.connection_id = message.connection_id); - message.ordering !== undefined && - (obj.ordering = orderToJSON(message.ordering)); - message.counterparty !== undefined && - (obj.counterparty = message.counterparty - ? Counterparty.toJSON(message.counterparty) - : undefined); - message.proposed_version !== undefined && - (obj.proposed_version = message.proposed_version); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAppVersionRequest { - const message = { ...baseQueryAppVersionRequest } as QueryAppVersionRequest; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.connection_id !== undefined && object.connection_id !== null) { - message.connection_id = object.connection_id; - } else { - message.connection_id = ""; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = object.ordering; - } else { - message.ordering = 0; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromPartial(object.counterparty); - } else { - message.counterparty = undefined; - } - if ( - object.proposed_version !== undefined && - object.proposed_version !== null - ) { - message.proposed_version = object.proposed_version; - } else { - message.proposed_version = ""; - } - return message; - }, -}; - -const baseQueryAppVersionResponse: object = { port_id: "", version: "" }; - -export const QueryAppVersionResponse = { - encode( - message: QueryAppVersionResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.port_id !== "") { - writer.uint32(10).string(message.port_id); - } - if (message.version !== "") { - writer.uint32(18).string(message.version); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryAppVersionResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAppVersionResponse, - } as QueryAppVersionResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAppVersionResponse { - const message = { - ...baseQueryAppVersionResponse, - } as QueryAppVersionResponse; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = String(object.port_id); - } else { - message.port_id = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - return message; - }, - - toJSON(message: QueryAppVersionResponse): unknown { - const obj: any = {}; - message.port_id !== undefined && (obj.port_id = message.port_id); - message.version !== undefined && (obj.version = message.version); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAppVersionResponse { - const message = { - ...baseQueryAppVersionResponse, - } as QueryAppVersionResponse; - if (object.port_id !== undefined && object.port_id !== null) { - message.port_id = object.port_id; - } else { - message.port_id = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - return message; - }, -}; - -/** Query defines the gRPC querier service */ -export interface Query { - /** AppVersion queries an IBC Port and determines the appropriate application version to be used */ - AppVersion(request: QueryAppVersionRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - AppVersion( - request: QueryAppVersionRequest - ): Promise { - const data = QueryAppVersionRequest.encode(request).finish(); - const promise = this.rpc.request( - "ibc.core.port.v1.Query", - "AppVersion", - data - ); - return promise.then((data) => - QueryAppVersionResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/package.json b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/package.json deleted file mode 100644 index 22545c0f..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "ibc-core-port-v1-js", - "version": "0.1.0", - "description": "Autogenerated vuex store for Cosmos module ibc.core.port.v1", - "author": "Starport Codegen ", - "homepage": "http://github.com/cosmos/ibc-go/v2/modules/core/05-port/types", - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "index.js", - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/vuex-root b/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/vuex-root deleted file mode 100644 index 0fcc121a..00000000 --- a/vue/src/store/generated/cosmos/ibc-go/ibc.core.port.v1/vuex-root +++ /dev/null @@ -1 +0,0 @@ -THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/fairyring.fairblock/index.ts b/vue/src/store/generated/fairyring.fairblock/index.ts deleted file mode 100755 index 0fdaed4d..00000000 --- a/vue/src/store/generated/fairyring.fairblock/index.ts +++ /dev/null @@ -1,479 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { AggregatedKeyShare } from "fairyring-client-ts/fairyring.fairblock/types" -import { EncryptedTx } from "fairyring-client-ts/fairyring.fairblock/types" -import { EncryptedTxArray } from "fairyring-client-ts/fairyring.fairblock/types" -import { FairblockExecutedNonce } from "fairyring-client-ts/fairyring.fairblock/types" -import { FairblockNonce } from "fairyring-client-ts/fairyring.fairblock/types" -import { FairblockTx } from "fairyring-client-ts/fairyring.fairblock/types" -import { FairblockPacketData } from "fairyring-client-ts/fairyring.fairblock/types" -import { NoData } from "fairyring-client-ts/fairyring.fairblock/types" -import { CurrentHeightPacketData } from "fairyring-client-ts/fairyring.fairblock/types" -import { CurrentHeightPacketAck } from "fairyring-client-ts/fairyring.fairblock/types" -import { Params } from "fairyring-client-ts/fairyring.fairblock/types" - - -export { AggregatedKeyShare, EncryptedTx, EncryptedTxArray, FairblockExecutedNonce, FairblockNonce, FairblockTx, FairblockPacketData, NoData, CurrentHeightPacketData, CurrentHeightPacketAck, Params }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - EncryptedTx: {}, - EncryptedTxAll: {}, - EncryptedTxAllFromHeight: {}, - LatestHeight: {}, - FairblockNonce: {}, - FairblockNonceAll: {}, - FairblockExecutedNonce: {}, - FairblockExecutedNonceAll: {}, - - _Structure: { - AggregatedKeyShare: getStructure(AggregatedKeyShare.fromPartial({})), - EncryptedTx: getStructure(EncryptedTx.fromPartial({})), - EncryptedTxArray: getStructure(EncryptedTxArray.fromPartial({})), - FairblockExecutedNonce: getStructure(FairblockExecutedNonce.fromPartial({})), - FairblockNonce: getStructure(FairblockNonce.fromPartial({})), - FairblockTx: getStructure(FairblockTx.fromPartial({})), - FairblockPacketData: getStructure(FairblockPacketData.fromPartial({})), - NoData: getStructure(NoData.fromPartial({})), - CurrentHeightPacketData: getStructure(CurrentHeightPacketData.fromPartial({})), - CurrentHeightPacketAck: getStructure(CurrentHeightPacketAck.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getEncryptedTx: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.EncryptedTx[JSON.stringify(params)] ?? {} - }, - getEncryptedTxAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.EncryptedTxAll[JSON.stringify(params)] ?? {} - }, - getEncryptedTxAllFromHeight: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.EncryptedTxAllFromHeight[JSON.stringify(params)] ?? {} - }, - getLatestHeight: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.LatestHeight[JSON.stringify(params)] ?? {} - }, - getFairblockNonce: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.FairblockNonce[JSON.stringify(params)] ?? {} - }, - getFairblockNonceAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.FairblockNonceAll[JSON.stringify(params)] ?? {} - }, - getFairblockExecutedNonce: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.FairblockExecutedNonce[JSON.stringify(params)] ?? {} - }, - getFairblockExecutedNonceAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.FairblockExecutedNonceAll[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: fairyring.fairblock initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairblock.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryEncryptedTx({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairblock.query.queryEncryptedTx( key.targetHeight, key.index)).data - - - commit('QUERY', { query: 'EncryptedTx', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryEncryptedTx', payload: { options: { all }, params: {...key},query }}) - return getters['getEncryptedTx']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryEncryptedTx API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryEncryptedTxAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairblock.query.queryEncryptedTxAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringFairblock.query.queryEncryptedTxAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'EncryptedTxAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryEncryptedTxAll', payload: { options: { all }, params: {...key},query }}) - return getters['getEncryptedTxAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryEncryptedTxAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryEncryptedTxAllFromHeight({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairblock.query.queryEncryptedTxAllFromHeight( key.targetHeight)).data - - - commit('QUERY', { query: 'EncryptedTxAllFromHeight', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryEncryptedTxAllFromHeight', payload: { options: { all }, params: {...key},query }}) - return getters['getEncryptedTxAllFromHeight']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryEncryptedTxAllFromHeight API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryLatestHeight({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairblock.query.queryLatestHeight()).data - - - commit('QUERY', { query: 'LatestHeight', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryLatestHeight', payload: { options: { all }, params: {...key},query }}) - return getters['getLatestHeight']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryLatestHeight API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryFairblockNonce({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairblock.query.queryFairblockNonce( key.address)).data - - - commit('QUERY', { query: 'FairblockNonce', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryFairblockNonce', payload: { options: { all }, params: {...key},query }}) - return getters['getFairblockNonce']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryFairblockNonce API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryFairblockNonceAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairblock.query.queryFairblockNonceAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringFairblock.query.queryFairblockNonceAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'FairblockNonceAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryFairblockNonceAll', payload: { options: { all }, params: {...key},query }}) - return getters['getFairblockNonceAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryFairblockNonceAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryFairblockExecutedNonce({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairblock.query.queryFairblockExecutedNonce( key.address)).data - - - commit('QUERY', { query: 'FairblockExecutedNonce', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryFairblockExecutedNonce', payload: { options: { all }, params: {...key},query }}) - return getters['getFairblockExecutedNonce']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryFairblockExecutedNonce API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryFairblockExecutedNonceAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairblock.query.queryFairblockExecutedNonceAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringFairblock.query.queryFairblockExecutedNonceAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'FairblockExecutedNonceAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryFairblockExecutedNonceAll', payload: { options: { all }, params: {...key},query }}) - return getters['getFairblockExecutedNonceAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryFairblockExecutedNonceAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgSendCurrentHeight({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringFairblock.tx.sendMsgSendCurrentHeight({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSendCurrentHeight:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSendCurrentHeight:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgSubmitEncryptedTx({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringFairblock.tx.sendMsgSubmitEncryptedTx({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitEncryptedTx:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitEncryptedTx:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreateAggregatedKeyShare({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringFairblock.tx.sendMsgCreateAggregatedKeyShare({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateAggregatedKeyShare:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateAggregatedKeyShare:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgSendCurrentHeight({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringFairblock.tx.msgSendCurrentHeight({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSendCurrentHeight:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSendCurrentHeight:Create Could not create message: ' + e.message) - } - } - }, - async MsgSubmitEncryptedTx({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringFairblock.tx.msgSubmitEncryptedTx({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitEncryptedTx:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitEncryptedTx:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreateAggregatedKeyShare({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringFairblock.tx.msgCreateAggregatedKeyShare({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateAggregatedKeyShare:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreateAggregatedKeyShare:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/fairyring.fairyring/index.ts b/vue/src/store/generated/fairyring.fairyring/index.ts deleted file mode 100755 index da7ce613..00000000 --- a/vue/src/store/generated/fairyring.fairyring/index.ts +++ /dev/null @@ -1,525 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { AggregatedKeyShare } from "fairyring-client-ts/fairyring.fairyring/types" -import { KeyShare } from "fairyring-client-ts/fairyring.fairyring/types" -import { Params } from "fairyring-client-ts/fairyring.fairyring/types" -import { PubKeyID } from "fairyring-client-ts/fairyring.fairyring/types" -import { ValidatorSet } from "fairyring-client-ts/fairyring.fairyring/types" - - -export { AggregatedKeyShare, KeyShare, Params, PubKeyID, ValidatorSet }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - ValidatorSet: {}, - ValidatorSetAll: {}, - KeyShare: {}, - KeyShareAll: {}, - AggregatedKeyShare: {}, - AggregatedKeyShareAll: {}, - PubKeyID: {}, - PubKeyIDAll: {}, - - _Structure: { - AggregatedKeyShare: getStructure(AggregatedKeyShare.fromPartial({})), - KeyShare: getStructure(KeyShare.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - PubKeyID: getStructure(PubKeyID.fromPartial({})), - ValidatorSet: getStructure(ValidatorSet.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getValidatorSet: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorSet[JSON.stringify(params)] ?? {} - }, - getValidatorSetAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorSetAll[JSON.stringify(params)] ?? {} - }, - getKeyShare: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.KeyShare[JSON.stringify(params)] ?? {} - }, - getKeyShareAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.KeyShareAll[JSON.stringify(params)] ?? {} - }, - getAggregatedKeyShare: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AggregatedKeyShare[JSON.stringify(params)] ?? {} - }, - getAggregatedKeyShareAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AggregatedKeyShareAll[JSON.stringify(params)] ?? {} - }, - getPubKeyID: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PubKeyID[JSON.stringify(params)] ?? {} - }, - getPubKeyIDAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PubKeyIDAll[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: fairyring.fairyring initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairyring.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorSet({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairyring.query.queryValidatorSet( key.index)).data - - - commit('QUERY', { query: 'ValidatorSet', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorSet', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorSet']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorSet API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorSetAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairyring.query.queryValidatorSetAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringFairyring.query.queryValidatorSetAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ValidatorSetAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorSetAll', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorSetAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorSetAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryKeyShare({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairyring.query.queryKeyShare( key.validator, key.blockHeight)).data - - - commit('QUERY', { query: 'KeyShare', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryKeyShare', payload: { options: { all }, params: {...key},query }}) - return getters['getKeyShare']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryKeyShare API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryKeyShareAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairyring.query.queryKeyShareAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringFairyring.query.queryKeyShareAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'KeyShareAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryKeyShareAll', payload: { options: { all }, params: {...key},query }}) - return getters['getKeyShareAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryKeyShareAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAggregatedKeyShare({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairyring.query.queryAggregatedKeyShare( key.height)).data - - - commit('QUERY', { query: 'AggregatedKeyShare', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAggregatedKeyShare', payload: { options: { all }, params: {...key},query }}) - return getters['getAggregatedKeyShare']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAggregatedKeyShare API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAggregatedKeyShareAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairyring.query.queryAggregatedKeyShareAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringFairyring.query.queryAggregatedKeyShareAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AggregatedKeyShareAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAggregatedKeyShareAll', payload: { options: { all }, params: {...key},query }}) - return getters['getAggregatedKeyShareAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAggregatedKeyShareAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPubKeyID({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairyring.query.queryPubKeyID( key.height)).data - - - commit('QUERY', { query: 'PubKeyID', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPubKeyID', payload: { options: { all }, params: {...key},query }}) - return getters['getPubKeyID']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPubKeyID API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPubKeyIDAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringFairyring.query.queryPubKeyIDAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringFairyring.query.queryPubKeyIDAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'PubKeyIDAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPubKeyIDAll', payload: { options: { all }, params: {...key},query }}) - return getters['getPubKeyIDAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPubKeyIDAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgSendKeyshare({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringFairyring.tx.sendMsgSendKeyshare({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSendKeyshare:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSendKeyshare:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgRegisterValidator({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringFairyring.tx.sendMsgRegisterValidator({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRegisterValidator:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRegisterValidator:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgDeletePubKeyID({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringFairyring.tx.sendMsgDeletePubKeyID({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeletePubKeyID:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgDeletePubKeyID:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdatePubKeyID({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringFairyring.tx.sendMsgUpdatePubKeyID({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdatePubKeyID:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdatePubKeyID:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreatePubKeyID({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringFairyring.tx.sendMsgCreatePubKeyID({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreatePubKeyID:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreatePubKeyID:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgSendKeyshare({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringFairyring.tx.msgSendKeyshare({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSendKeyshare:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSendKeyshare:Create Could not create message: ' + e.message) - } - } - }, - async MsgRegisterValidator({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringFairyring.tx.msgRegisterValidator({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRegisterValidator:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgRegisterValidator:Create Could not create message: ' + e.message) - } - } - }, - async MsgDeletePubKeyID({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringFairyring.tx.msgDeletePubKeyID({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeletePubKeyID:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgDeletePubKeyID:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdatePubKeyID({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringFairyring.tx.msgUpdatePubKeyID({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdatePubKeyID:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdatePubKeyID:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreatePubKeyID({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringFairyring.tx.msgCreatePubKeyID({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreatePubKeyID:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreatePubKeyID:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/fairyring.keyshare/index.ts b/vue/src/store/generated/fairyring.keyshare/index.ts deleted file mode 100755 index ed9f733f..00000000 --- a/vue/src/store/generated/fairyring.keyshare/index.ts +++ /dev/null @@ -1,630 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { AggregatedKeyShare } from "fairyring-client-ts/fairyring.keyshare/types" -import { AuthorizedAddress } from "fairyring-client-ts/fairyring.keyshare/types" -import { Commitments } from "fairyring-client-ts/fairyring.keyshare/types" -import { KeyShare } from "fairyring-client-ts/fairyring.keyshare/types" -import { KeysharePacketData } from "fairyring-client-ts/fairyring.keyshare/types" -import { NoData } from "fairyring-client-ts/fairyring.keyshare/types" -import { RequestAggrKeysharePacketData } from "fairyring-client-ts/fairyring.keyshare/types" -import { RequestAggrKeysharePacketAck } from "fairyring-client-ts/fairyring.keyshare/types" -import { GetAggrKeysharePacketData } from "fairyring-client-ts/fairyring.keyshare/types" -import { GetAggrKeysharePacketAck } from "fairyring-client-ts/fairyring.keyshare/types" -import { AggrKeyshareDataPacketData } from "fairyring-client-ts/fairyring.keyshare/types" -import { AggrKeyshareDataPacketAck } from "fairyring-client-ts/fairyring.keyshare/types" -import { Params } from "fairyring-client-ts/fairyring.keyshare/types" -import { ActivePubKey } from "fairyring-client-ts/fairyring.keyshare/types" -import { QueuedPubKey } from "fairyring-client-ts/fairyring.keyshare/types" -import { ValidatorSet } from "fairyring-client-ts/fairyring.keyshare/types" - - -export { AggregatedKeyShare, AuthorizedAddress, Commitments, KeyShare, KeysharePacketData, NoData, RequestAggrKeysharePacketData, RequestAggrKeysharePacketAck, GetAggrKeysharePacketData, GetAggrKeysharePacketAck, AggrKeyshareDataPacketData, AggrKeyshareDataPacketAck, Params, ActivePubKey, QueuedPubKey, ValidatorSet }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - ValidatorSet: {}, - ValidatorSetAll: {}, - KeyShare: {}, - KeyShareAll: {}, - AggregatedKeyShare: {}, - AggregatedKeyShareAll: {}, - PubKey: {}, - AuthorizedAddress: {}, - AuthorizedAddressAll: {}, - - _Structure: { - AggregatedKeyShare: getStructure(AggregatedKeyShare.fromPartial({})), - AuthorizedAddress: getStructure(AuthorizedAddress.fromPartial({})), - Commitments: getStructure(Commitments.fromPartial({})), - KeyShare: getStructure(KeyShare.fromPartial({})), - KeysharePacketData: getStructure(KeysharePacketData.fromPartial({})), - NoData: getStructure(NoData.fromPartial({})), - RequestAggrKeysharePacketData: getStructure(RequestAggrKeysharePacketData.fromPartial({})), - RequestAggrKeysharePacketAck: getStructure(RequestAggrKeysharePacketAck.fromPartial({})), - GetAggrKeysharePacketData: getStructure(GetAggrKeysharePacketData.fromPartial({})), - GetAggrKeysharePacketAck: getStructure(GetAggrKeysharePacketAck.fromPartial({})), - AggrKeyshareDataPacketData: getStructure(AggrKeyshareDataPacketData.fromPartial({})), - AggrKeyshareDataPacketAck: getStructure(AggrKeyshareDataPacketAck.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - ActivePubKey: getStructure(ActivePubKey.fromPartial({})), - QueuedPubKey: getStructure(QueuedPubKey.fromPartial({})), - ValidatorSet: getStructure(ValidatorSet.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getValidatorSet: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorSet[JSON.stringify(params)] ?? {} - }, - getValidatorSetAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ValidatorSetAll[JSON.stringify(params)] ?? {} - }, - getKeyShare: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.KeyShare[JSON.stringify(params)] ?? {} - }, - getKeyShareAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.KeyShareAll[JSON.stringify(params)] ?? {} - }, - getAggregatedKeyShare: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AggregatedKeyShare[JSON.stringify(params)] ?? {} - }, - getAggregatedKeyShareAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AggregatedKeyShareAll[JSON.stringify(params)] ?? {} - }, - getPubKey: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PubKey[JSON.stringify(params)] ?? {} - }, - getAuthorizedAddress: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AuthorizedAddress[JSON.stringify(params)] ?? {} - }, - getAuthorizedAddressAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AuthorizedAddressAll[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: fairyring.keyshare initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorSet({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryValidatorSet( key.index)).data - - - commit('QUERY', { query: 'ValidatorSet', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorSet', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorSet']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorSet API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryValidatorSetAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryValidatorSetAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringKeyshare.query.queryValidatorSetAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ValidatorSetAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryValidatorSetAll', payload: { options: { all }, params: {...key},query }}) - return getters['getValidatorSetAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryValidatorSetAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryKeyShare({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryKeyShare( key.validator, key.blockHeight)).data - - - commit('QUERY', { query: 'KeyShare', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryKeyShare', payload: { options: { all }, params: {...key},query }}) - return getters['getKeyShare']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryKeyShare API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryKeyShareAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryKeyShareAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringKeyshare.query.queryKeyShareAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'KeyShareAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryKeyShareAll', payload: { options: { all }, params: {...key},query }}) - return getters['getKeyShareAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryKeyShareAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAggregatedKeyShare({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryAggregatedKeyShare( key.height)).data - - - commit('QUERY', { query: 'AggregatedKeyShare', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAggregatedKeyShare', payload: { options: { all }, params: {...key},query }}) - return getters['getAggregatedKeyShare']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAggregatedKeyShare API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAggregatedKeyShareAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryAggregatedKeyShareAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringKeyshare.query.queryAggregatedKeyShareAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AggregatedKeyShareAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAggregatedKeyShareAll', payload: { options: { all }, params: {...key},query }}) - return getters['getAggregatedKeyShareAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAggregatedKeyShareAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPubKey({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryPubKey()).data - - - commit('QUERY', { query: 'PubKey', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPubKey', payload: { options: { all }, params: {...key},query }}) - return getters['getPubKey']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPubKey API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAuthorizedAddress({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryAuthorizedAddress( key.target)).data - - - commit('QUERY', { query: 'AuthorizedAddress', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAuthorizedAddress', payload: { options: { all }, params: {...key},query }}) - return getters['getAuthorizedAddress']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAuthorizedAddress API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryAuthorizedAddressAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringKeyshare.query.queryAuthorizedAddressAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringKeyshare.query.queryAuthorizedAddressAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AuthorizedAddressAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAuthorizedAddressAll', payload: { options: { all }, params: {...key},query }}) - return getters['getAuthorizedAddressAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAuthorizedAddressAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgSendKeyshare({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringKeyshare.tx.sendMsgSendKeyshare({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSendKeyshare:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSendKeyshare:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgDeleteAuthorizedAddress({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringKeyshare.tx.sendMsgDeleteAuthorizedAddress({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeleteAuthorizedAddress:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgDeleteAuthorizedAddress:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgRegisterValidator({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringKeyshare.tx.sendMsgRegisterValidator({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRegisterValidator:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRegisterValidator:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgUpdateAuthorizedAddress({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringKeyshare.tx.sendMsgUpdateAuthorizedAddress({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateAuthorizedAddress:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgUpdateAuthorizedAddress:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreateLatestPubKey({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringKeyshare.tx.sendMsgCreateLatestPubKey({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateLatestPubKey:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateLatestPubKey:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreateAuthorizedAddress({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringKeyshare.tx.sendMsgCreateAuthorizedAddress({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateAuthorizedAddress:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateAuthorizedAddress:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgSendAggrKeyshareData({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringKeyshare.tx.sendMsgSendAggrKeyshareData({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSendAggrKeyshareData:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSendAggrKeyshareData:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgSendKeyshare({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringKeyshare.tx.msgSendKeyshare({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSendKeyshare:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSendKeyshare:Create Could not create message: ' + e.message) - } - } - }, - async MsgDeleteAuthorizedAddress({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringKeyshare.tx.msgDeleteAuthorizedAddress({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgDeleteAuthorizedAddress:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgDeleteAuthorizedAddress:Create Could not create message: ' + e.message) - } - } - }, - async MsgRegisterValidator({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringKeyshare.tx.msgRegisterValidator({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRegisterValidator:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgRegisterValidator:Create Could not create message: ' + e.message) - } - } - }, - async MsgUpdateAuthorizedAddress({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringKeyshare.tx.msgUpdateAuthorizedAddress({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgUpdateAuthorizedAddress:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgUpdateAuthorizedAddress:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreateLatestPubKey({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringKeyshare.tx.msgCreateLatestPubKey({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateLatestPubKey:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreateLatestPubKey:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreateAuthorizedAddress({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringKeyshare.tx.msgCreateAuthorizedAddress({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateAuthorizedAddress:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreateAuthorizedAddress:Create Could not create message: ' + e.message) - } - } - }, - async MsgSendAggrKeyshareData({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringKeyshare.tx.msgSendAggrKeyshareData({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSendAggrKeyshareData:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSendAggrKeyshareData:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/fairyring.pep/index.ts b/vue/src/store/generated/fairyring.pep/index.ts deleted file mode 100755 index 8aaebc61..00000000 --- a/vue/src/store/generated/fairyring.pep/index.ts +++ /dev/null @@ -1,421 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { AggregatedKeyShare } from "fairyring-client-ts/fairyring.pep/types" -import { EncryptedTx } from "fairyring-client-ts/fairyring.pep/types" -import { EncryptedTxArray } from "fairyring-client-ts/fairyring.pep/types" -import { PepPacketData } from "fairyring-client-ts/fairyring.pep/types" -import { NoData } from "fairyring-client-ts/fairyring.pep/types" -import { CurrentKeysPacketData } from "fairyring-client-ts/fairyring.pep/types" -import { CurrentKeysPacketAck } from "fairyring-client-ts/fairyring.pep/types" -import { Params } from "fairyring-client-ts/fairyring.pep/types" -import { TrustedCounterParty } from "fairyring-client-ts/fairyring.pep/types" -import { PepNonce } from "fairyring-client-ts/fairyring.pep/types" -import { ActivePubKey } from "fairyring-client-ts/fairyring.pep/types" -import { QueuedPubKey } from "fairyring-client-ts/fairyring.pep/types" - - -export { AggregatedKeyShare, EncryptedTx, EncryptedTxArray, PepPacketData, NoData, CurrentKeysPacketData, CurrentKeysPacketAck, Params, TrustedCounterParty, PepNonce, ActivePubKey, QueuedPubKey }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - EncryptedTx: {}, - EncryptedTxAll: {}, - EncryptedTxAllFromHeight: {}, - LatestHeight: {}, - PepNonce: {}, - PepNonceAll: {}, - PubKey: {}, - - _Structure: { - AggregatedKeyShare: getStructure(AggregatedKeyShare.fromPartial({})), - EncryptedTx: getStructure(EncryptedTx.fromPartial({})), - EncryptedTxArray: getStructure(EncryptedTxArray.fromPartial({})), - PepPacketData: getStructure(PepPacketData.fromPartial({})), - NoData: getStructure(NoData.fromPartial({})), - CurrentKeysPacketData: getStructure(CurrentKeysPacketData.fromPartial({})), - CurrentKeysPacketAck: getStructure(CurrentKeysPacketAck.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - TrustedCounterParty: getStructure(TrustedCounterParty.fromPartial({})), - PepNonce: getStructure(PepNonce.fromPartial({})), - ActivePubKey: getStructure(ActivePubKey.fromPartial({})), - QueuedPubKey: getStructure(QueuedPubKey.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getEncryptedTx: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.EncryptedTx[JSON.stringify(params)] ?? {} - }, - getEncryptedTxAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.EncryptedTxAll[JSON.stringify(params)] ?? {} - }, - getEncryptedTxAllFromHeight: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.EncryptedTxAllFromHeight[JSON.stringify(params)] ?? {} - }, - getLatestHeight: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.LatestHeight[JSON.stringify(params)] ?? {} - }, - getPepNonce: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PepNonce[JSON.stringify(params)] ?? {} - }, - getPepNonceAll: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PepNonceAll[JSON.stringify(params)] ?? {} - }, - getPubKey: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PubKey[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: fairyring.pep initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringPep.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryEncryptedTx({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringPep.query.queryEncryptedTx( key.targetHeight, key.index)).data - - - commit('QUERY', { query: 'EncryptedTx', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryEncryptedTx', payload: { options: { all }, params: {...key},query }}) - return getters['getEncryptedTx']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryEncryptedTx API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryEncryptedTxAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringPep.query.queryEncryptedTxAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringPep.query.queryEncryptedTxAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'EncryptedTxAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryEncryptedTxAll', payload: { options: { all }, params: {...key},query }}) - return getters['getEncryptedTxAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryEncryptedTxAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryEncryptedTxAllFromHeight({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringPep.query.queryEncryptedTxAllFromHeight( key.targetHeight)).data - - - commit('QUERY', { query: 'EncryptedTxAllFromHeight', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryEncryptedTxAllFromHeight', payload: { options: { all }, params: {...key},query }}) - return getters['getEncryptedTxAllFromHeight']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryEncryptedTxAllFromHeight API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryLatestHeight({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringPep.query.queryLatestHeight()).data - - - commit('QUERY', { query: 'LatestHeight', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryLatestHeight', payload: { options: { all }, params: {...key},query }}) - return getters['getLatestHeight']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryLatestHeight API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPepNonce({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringPep.query.queryPepNonce( key.address)).data - - - commit('QUERY', { query: 'PepNonce', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPepNonce', payload: { options: { all }, params: {...key},query }}) - return getters['getPepNonce']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPepNonce API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPepNonceAll({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringPep.query.queryPepNonceAll(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.FairyringPep.query.queryPepNonceAll({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'PepNonceAll', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPepNonceAll', payload: { options: { all }, params: {...key},query }}) - return getters['getPepNonceAll']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPepNonceAll API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPubKey({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.FairyringPep.query.queryPubKey()).data - - - commit('QUERY', { query: 'PubKey', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPubKey', payload: { options: { all }, params: {...key},query }}) - return getters['getPubKey']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPubKey API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgSubmitEncryptedTx({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringPep.tx.sendMsgSubmitEncryptedTx({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitEncryptedTx:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitEncryptedTx:Send Could not broadcast Tx: '+ e.message) - } - } - }, - async sendMsgCreateAggregatedKeyShare({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.FairyringPep.tx.sendMsgCreateAggregatedKeyShare({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateAggregatedKeyShare:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCreateAggregatedKeyShare:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgSubmitEncryptedTx({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringPep.tx.msgSubmitEncryptedTx({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitEncryptedTx:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitEncryptedTx:Create Could not create message: ' + e.message) - } - } - }, - async MsgCreateAggregatedKeyShare({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.FairyringPep.tx.msgCreateAggregatedKeyShare({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateAggregatedKeyShare:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCreateAggregatedKeyShare:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/ibc.applications.interchain_accounts.controller.v1/index.ts b/vue/src/store/generated/ibc.applications.interchain_accounts.controller.v1/index.ts deleted file mode 100755 index d4074c89..00000000 --- a/vue/src/store/generated/ibc.applications.interchain_accounts.controller.v1/index.ts +++ /dev/null @@ -1,163 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Params } from "fairyring-client-ts/ibc.applications.interchain_accounts.controller.v1/types" - - -export { Params }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - InterchainAccount: {}, - Params: {}, - - _Structure: { - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getInterchainAccount: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.InterchainAccount[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.applications.interchain_accounts.controller.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryInterchainAccount({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcApplicationsInterchainAccountsControllerV1.query.queryInterchainAccount( key.owner, key.connection_id)).data - - - commit('QUERY', { query: 'InterchainAccount', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryInterchainAccount', payload: { options: { all }, params: {...key},query }}) - return getters['getInterchainAccount']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryInterchainAccount API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcApplicationsInterchainAccountsControllerV1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/ibc.applications.interchain_accounts.host.v1/index.ts b/vue/src/store/generated/ibc.applications.interchain_accounts.host.v1/index.ts deleted file mode 100755 index cc032df4..00000000 --- a/vue/src/store/generated/ibc.applications.interchain_accounts.host.v1/index.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Params } from "fairyring-client-ts/ibc.applications.interchain_accounts.host.v1/types" - - -export { Params }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Params: {}, - - _Structure: { - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.applications.interchain_accounts.host.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcApplicationsInterchainAccountsHostV1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/ibc.applications.transfer.v1/index.ts b/vue/src/store/generated/ibc.applications.transfer.v1/index.ts deleted file mode 100755 index 336d38dd..00000000 --- a/vue/src/store/generated/ibc.applications.transfer.v1/index.ts +++ /dev/null @@ -1,316 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Allocation } from "fairyring-client-ts/ibc.applications.transfer.v1/types" -import { TransferAuthorization } from "fairyring-client-ts/ibc.applications.transfer.v1/types" -import { DenomTrace } from "fairyring-client-ts/ibc.applications.transfer.v1/types" -import { Params } from "fairyring-client-ts/ibc.applications.transfer.v1/types" - - -export { Allocation, TransferAuthorization, DenomTrace, Params }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - DenomTrace: {}, - DenomTraces: {}, - Params: {}, - DenomHash: {}, - EscrowAddress: {}, - TotalEscrowForDenom: {}, - - _Structure: { - Allocation: getStructure(Allocation.fromPartial({})), - TransferAuthorization: getStructure(TransferAuthorization.fromPartial({})), - DenomTrace: getStructure(DenomTrace.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getDenomTrace: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomTrace[JSON.stringify(params)] ?? {} - }, - getDenomTraces: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomTraces[JSON.stringify(params)] ?? {} - }, - getParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Params[JSON.stringify(params)] ?? {} - }, - getDenomHash: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.DenomHash[JSON.stringify(params)] ?? {} - }, - getEscrowAddress: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.EscrowAddress[JSON.stringify(params)] ?? {} - }, - getTotalEscrowForDenom: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.TotalEscrowForDenom[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.applications.transfer.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryDenomTrace({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcApplicationsTransferV1.query.queryDenomTrace( key.hash=**)).data - - - commit('QUERY', { query: 'DenomTrace', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomTrace', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomTrace']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomTrace API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDenomTraces({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcApplicationsTransferV1.query.queryDenomTraces(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcApplicationsTransferV1.query.queryDenomTraces({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'DenomTraces', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomTraces', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomTraces']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomTraces API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcApplicationsTransferV1.query.queryParams()).data - - - commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) - return getters['getParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryDenomHash({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcApplicationsTransferV1.query.queryDenomHash( key.trace=**)).data - - - commit('QUERY', { query: 'DenomHash', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryDenomHash', payload: { options: { all }, params: {...key},query }}) - return getters['getDenomHash']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryDenomHash API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryEscrowAddress({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcApplicationsTransferV1.query.queryEscrowAddress( key.channel_id, key.port_id)).data - - - commit('QUERY', { query: 'EscrowAddress', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryEscrowAddress', payload: { options: { all }, params: {...key},query }}) - return getters['getEscrowAddress']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryEscrowAddress API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryTotalEscrowForDenom({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcApplicationsTransferV1.query.queryTotalEscrowForDenom( key.denom=**)).data - - - commit('QUERY', { query: 'TotalEscrowForDenom', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryTotalEscrowForDenom', payload: { options: { all }, params: {...key},query }}) - return getters['getTotalEscrowForDenom']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryTotalEscrowForDenom API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - async sendMsgTransfer({ rootGetters }, { value, fee = {amount: [], gas: "200000"}, memo = '' }) { - try { - const client=await initClient(rootGetters) - const fullFee = Array.isArray(fee) ? {amount: fee, gas: "200000"} :fee; - const result = await client.IbcApplicationsTransferV1.tx.sendMsgTransfer({ value, fee: fullFee, memo }) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgTransfer:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgTransfer:Send Could not broadcast Tx: '+ e.message) - } - } - }, - - async MsgTransfer({ rootGetters }, { value }) { - try { - const client=initClient(rootGetters) - const msg = await client.IbcApplicationsTransferV1.tx.msgTransfer({value}) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgTransfer:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgTransfer:Create Could not create message: ' + e.message) - } - } - }, - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/ibc.core.channel.v1/index.ts b/vue/src/store/generated/ibc.core.channel.v1/index.ts deleted file mode 100755 index b096b5e0..00000000 --- a/vue/src/store/generated/ibc.core.channel.v1/index.ts +++ /dev/null @@ -1,512 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { Channel } from "fairyring-client-ts/ibc.core.channel.v1/types" -import { IdentifiedChannel } from "fairyring-client-ts/ibc.core.channel.v1/types" -import { Counterparty } from "fairyring-client-ts/ibc.core.channel.v1/types" -import { Packet } from "fairyring-client-ts/ibc.core.channel.v1/types" -import { PacketState } from "fairyring-client-ts/ibc.core.channel.v1/types" -import { PacketId } from "fairyring-client-ts/ibc.core.channel.v1/types" -import { Acknowledgement } from "fairyring-client-ts/ibc.core.channel.v1/types" -import { PacketSequence } from "fairyring-client-ts/ibc.core.channel.v1/types" - - -export { Channel, IdentifiedChannel, Counterparty, Packet, PacketState, PacketId, Acknowledgement, PacketSequence }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Channel: {}, - Channels: {}, - ConnectionChannels: {}, - ChannelClientState: {}, - ChannelConsensusState: {}, - PacketCommitment: {}, - PacketCommitments: {}, - PacketReceipt: {}, - PacketAcknowledgement: {}, - PacketAcknowledgements: {}, - UnreceivedPackets: {}, - UnreceivedAcks: {}, - NextSequenceReceive: {}, - - _Structure: { - Channel: getStructure(Channel.fromPartial({})), - IdentifiedChannel: getStructure(IdentifiedChannel.fromPartial({})), - Counterparty: getStructure(Counterparty.fromPartial({})), - Packet: getStructure(Packet.fromPartial({})), - PacketState: getStructure(PacketState.fromPartial({})), - PacketId: getStructure(PacketId.fromPartial({})), - Acknowledgement: getStructure(Acknowledgement.fromPartial({})), - PacketSequence: getStructure(PacketSequence.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getChannel: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Channel[JSON.stringify(params)] ?? {} - }, - getChannels: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Channels[JSON.stringify(params)] ?? {} - }, - getConnectionChannels: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConnectionChannels[JSON.stringify(params)] ?? {} - }, - getChannelClientState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ChannelClientState[JSON.stringify(params)] ?? {} - }, - getChannelConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ChannelConsensusState[JSON.stringify(params)] ?? {} - }, - getPacketCommitment: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketCommitment[JSON.stringify(params)] ?? {} - }, - getPacketCommitments: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketCommitments[JSON.stringify(params)] ?? {} - }, - getPacketReceipt: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketReceipt[JSON.stringify(params)] ?? {} - }, - getPacketAcknowledgement: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketAcknowledgement[JSON.stringify(params)] ?? {} - }, - getPacketAcknowledgements: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.PacketAcknowledgements[JSON.stringify(params)] ?? {} - }, - getUnreceivedPackets: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UnreceivedPackets[JSON.stringify(params)] ?? {} - }, - getUnreceivedAcks: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UnreceivedAcks[JSON.stringify(params)] ?? {} - }, - getNextSequenceReceive: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.NextSequenceReceive[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.core.channel.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryChannel({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryChannel( key.channel_id, key.port_id)).data - - - commit('QUERY', { query: 'Channel', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryChannel', payload: { options: { all }, params: {...key},query }}) - return getters['getChannel']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryChannel API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryChannels({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryChannels(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcCoreChannelV1.query.queryChannels({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Channels', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryChannels', payload: { options: { all }, params: {...key},query }}) - return getters['getChannels']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryChannels API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConnectionChannels({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryConnectionChannels( key.connection, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcCoreChannelV1.query.queryConnectionChannels( key.connection, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ConnectionChannels', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnectionChannels', payload: { options: { all }, params: {...key},query }}) - return getters['getConnectionChannels']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnectionChannels API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryChannelClientState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryChannelClientState( key.channel_id, key.port_id)).data - - - commit('QUERY', { query: 'ChannelClientState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryChannelClientState', payload: { options: { all }, params: {...key},query }}) - return getters['getChannelClientState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryChannelClientState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryChannelConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryChannelConsensusState( key.channel_id, key.port_id, key.revision_number, key.revision_height)).data - - - commit('QUERY', { query: 'ChannelConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryChannelConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getChannelConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryChannelConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketCommitment({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryPacketCommitment( key.channel_id, key.port_id, key.sequence)).data - - - commit('QUERY', { query: 'PacketCommitment', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketCommitment', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketCommitment']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketCommitment API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketCommitments({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryPacketCommitments( key.channel_id, key.port_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcCoreChannelV1.query.queryPacketCommitments( key.channel_id, key.port_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'PacketCommitments', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketCommitments', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketCommitments']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketCommitments API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketReceipt({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryPacketReceipt( key.channel_id, key.port_id, key.sequence)).data - - - commit('QUERY', { query: 'PacketReceipt', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketReceipt', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketReceipt']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketReceipt API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketAcknowledgement({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryPacketAcknowledgement( key.channel_id, key.port_id, key.sequence)).data - - - commit('QUERY', { query: 'PacketAcknowledgement', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketAcknowledgement', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketAcknowledgement']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketAcknowledgement API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryPacketAcknowledgements({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryPacketAcknowledgements( key.channel_id, key.port_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcCoreChannelV1.query.queryPacketAcknowledgements( key.channel_id, key.port_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'PacketAcknowledgements', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryPacketAcknowledgements', payload: { options: { all }, params: {...key},query }}) - return getters['getPacketAcknowledgements']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryPacketAcknowledgements API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUnreceivedPackets({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryUnreceivedPackets( key.channel_id, key.port_id, key.packet_commitment_sequences)).data - - - commit('QUERY', { query: 'UnreceivedPackets', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUnreceivedPackets', payload: { options: { all }, params: {...key},query }}) - return getters['getUnreceivedPackets']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUnreceivedPackets API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUnreceivedAcks({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryUnreceivedAcks( key.channel_id, key.port_id, key.packet_ack_sequences)).data - - - commit('QUERY', { query: 'UnreceivedAcks', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUnreceivedAcks', payload: { options: { all }, params: {...key},query }}) - return getters['getUnreceivedAcks']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUnreceivedAcks API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryNextSequenceReceive({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreChannelV1.query.queryNextSequenceReceive( key.channel_id, key.port_id)).data - - - commit('QUERY', { query: 'NextSequenceReceive', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryNextSequenceReceive', payload: { options: { all }, params: {...key},query }}) - return getters['getNextSequenceReceive']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryNextSequenceReceive API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/ibc.core.client.v1/index.ts b/vue/src/store/generated/ibc.core.client.v1/index.ts deleted file mode 100755 index 5a75f6e2..00000000 --- a/vue/src/store/generated/ibc.core.client.v1/index.ts +++ /dev/null @@ -1,398 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { IdentifiedClientState } from "fairyring-client-ts/ibc.core.client.v1/types" -import { ConsensusStateWithHeight } from "fairyring-client-ts/ibc.core.client.v1/types" -import { ClientConsensusStates } from "fairyring-client-ts/ibc.core.client.v1/types" -import { ClientUpdateProposal } from "fairyring-client-ts/ibc.core.client.v1/types" -import { UpgradeProposal } from "fairyring-client-ts/ibc.core.client.v1/types" -import { Height } from "fairyring-client-ts/ibc.core.client.v1/types" -import { Params } from "fairyring-client-ts/ibc.core.client.v1/types" -import { GenesisMetadata } from "fairyring-client-ts/ibc.core.client.v1/types" -import { IdentifiedGenesisMetadata } from "fairyring-client-ts/ibc.core.client.v1/types" - - -export { IdentifiedClientState, ConsensusStateWithHeight, ClientConsensusStates, ClientUpdateProposal, UpgradeProposal, Height, Params, GenesisMetadata, IdentifiedGenesisMetadata }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - ClientState: {}, - ClientStates: {}, - ConsensusState: {}, - ConsensusStates: {}, - ConsensusStateHeights: {}, - ClientStatus: {}, - ClientParams: {}, - UpgradedClientState: {}, - UpgradedConsensusState: {}, - - _Structure: { - IdentifiedClientState: getStructure(IdentifiedClientState.fromPartial({})), - ConsensusStateWithHeight: getStructure(ConsensusStateWithHeight.fromPartial({})), - ClientConsensusStates: getStructure(ClientConsensusStates.fromPartial({})), - ClientUpdateProposal: getStructure(ClientUpdateProposal.fromPartial({})), - UpgradeProposal: getStructure(UpgradeProposal.fromPartial({})), - Height: getStructure(Height.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - GenesisMetadata: getStructure(GenesisMetadata.fromPartial({})), - IdentifiedGenesisMetadata: getStructure(IdentifiedGenesisMetadata.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getClientState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientState[JSON.stringify(params)] ?? {} - }, - getClientStates: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientStates[JSON.stringify(params)] ?? {} - }, - getConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConsensusState[JSON.stringify(params)] ?? {} - }, - getConsensusStates: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConsensusStates[JSON.stringify(params)] ?? {} - }, - getConsensusStateHeights: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConsensusStateHeights[JSON.stringify(params)] ?? {} - }, - getClientStatus: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientStatus[JSON.stringify(params)] ?? {} - }, - getClientParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientParams[JSON.stringify(params)] ?? {} - }, - getUpgradedClientState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UpgradedClientState[JSON.stringify(params)] ?? {} - }, - getUpgradedConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.UpgradedConsensusState[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.core.client.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryClientState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreClientV1.query.queryClientState( key.client_id)).data - - - commit('QUERY', { query: 'ClientState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientState', payload: { options: { all }, params: {...key},query }}) - return getters['getClientState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClientStates({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreClientV1.query.queryClientStates(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcCoreClientV1.query.queryClientStates({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ClientStates', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientStates', payload: { options: { all }, params: {...key},query }}) - return getters['getClientStates']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientStates API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreClientV1.query.queryConsensusState( key.client_id, key.revision_number, key.revision_height, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcCoreClientV1.query.queryConsensusState( key.client_id, key.revision_number, key.revision_height, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConsensusStates({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreClientV1.query.queryConsensusStates( key.client_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcCoreClientV1.query.queryConsensusStates( key.client_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ConsensusStates', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConsensusStates', payload: { options: { all }, params: {...key},query }}) - return getters['getConsensusStates']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConsensusStates API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConsensusStateHeights({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreClientV1.query.queryConsensusStateHeights( key.client_id, query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcCoreClientV1.query.queryConsensusStateHeights( key.client_id, {...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'ConsensusStateHeights', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConsensusStateHeights', payload: { options: { all }, params: {...key},query }}) - return getters['getConsensusStateHeights']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConsensusStateHeights API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClientStatus({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreClientV1.query.queryClientStatus( key.client_id)).data - - - commit('QUERY', { query: 'ClientStatus', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientStatus', payload: { options: { all }, params: {...key},query }}) - return getters['getClientStatus']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientStatus API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClientParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreClientV1.query.queryClientParams()).data - - - commit('QUERY', { query: 'ClientParams', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientParams', payload: { options: { all }, params: {...key},query }}) - return getters['getClientParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUpgradedClientState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreClientV1.query.queryUpgradedClientState()).data - - - commit('QUERY', { query: 'UpgradedClientState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUpgradedClientState', payload: { options: { all }, params: {...key},query }}) - return getters['getUpgradedClientState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUpgradedClientState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryUpgradedConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreClientV1.query.queryUpgradedConsensusState()).data - - - commit('QUERY', { query: 'UpgradedConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryUpgradedConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getUpgradedConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryUpgradedConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/ibc.core.connection.v1/index.ts b/vue/src/store/generated/ibc.core.connection.v1/index.ts deleted file mode 100755 index 1746e160..00000000 --- a/vue/src/store/generated/ibc.core.connection.v1/index.ts +++ /dev/null @@ -1,295 +0,0 @@ -import { Client, registry, MissingWalletError } from 'fairyring-client-ts' - -import { ConnectionEnd } from "fairyring-client-ts/ibc.core.connection.v1/types" -import { IdentifiedConnection } from "fairyring-client-ts/ibc.core.connection.v1/types" -import { Counterparty } from "fairyring-client-ts/ibc.core.connection.v1/types" -import { ClientPaths } from "fairyring-client-ts/ibc.core.connection.v1/types" -import { ConnectionPaths } from "fairyring-client-ts/ibc.core.connection.v1/types" -import { Version } from "fairyring-client-ts/ibc.core.connection.v1/types" -import { Params } from "fairyring-client-ts/ibc.core.connection.v1/types" - - -export { ConnectionEnd, IdentifiedConnection, Counterparty, ClientPaths, ConnectionPaths, Version, Params }; - -function initClient(vuexGetters) { - return new Client(vuexGetters['common/env/getEnv'], vuexGetters['common/wallet/signer']) -} - -function mergeResults(value, next_values) { - for (let prop of Object.keys(next_values)) { - if (Array.isArray(next_values[prop])) { - value[prop]=[...value[prop], ...next_values[prop]] - }else{ - value[prop]=next_values[prop] - } - } - return value -} - -type Field = { - name: string; - type: unknown; -} -function getStructure(template) { - let structure: {fields: Field[]} = { fields: [] } - for (const [key, value] of Object.entries(template)) { - let field = { name: key, type: typeof value } - structure.fields.push(field) - } - return structure -} -const getDefaultState = () => { - return { - Connection: {}, - Connections: {}, - ClientConnections: {}, - ConnectionClientState: {}, - ConnectionConsensusState: {}, - ConnectionParams: {}, - - _Structure: { - ConnectionEnd: getStructure(ConnectionEnd.fromPartial({})), - IdentifiedConnection: getStructure(IdentifiedConnection.fromPartial({})), - Counterparty: getStructure(Counterparty.fromPartial({})), - ClientPaths: getStructure(ClientPaths.fromPartial({})), - ConnectionPaths: getStructure(ConnectionPaths.fromPartial({})), - Version: getStructure(Version.fromPartial({})), - Params: getStructure(Params.fromPartial({})), - - }, - _Registry: registry, - _Subscriptions: new Set(), - } -} - -// initial state -const state = getDefaultState() - -export default { - namespaced: true, - state, - mutations: { - RESET_STATE(state) { - Object.assign(state, getDefaultState()) - }, - QUERY(state, { query, key, value }) { - state[query][JSON.stringify(key)] = value - }, - SUBSCRIBE(state, subscription) { - state._Subscriptions.add(JSON.stringify(subscription)) - }, - UNSUBSCRIBE(state, subscription) { - state._Subscriptions.delete(JSON.stringify(subscription)) - } - }, - getters: { - getConnection: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Connection[JSON.stringify(params)] ?? {} - }, - getConnections: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.Connections[JSON.stringify(params)] ?? {} - }, - getClientConnections: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ClientConnections[JSON.stringify(params)] ?? {} - }, - getConnectionClientState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConnectionClientState[JSON.stringify(params)] ?? {} - }, - getConnectionConsensusState: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConnectionConsensusState[JSON.stringify(params)] ?? {} - }, - getConnectionParams: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.ConnectionParams[JSON.stringify(params)] ?? {} - }, - - getTypeStructure: (state) => (type) => { - return state._Structure[type].fields - }, - getRegistry: (state) => { - return state._Registry - } - }, - actions: { - init({ dispatch, rootGetters }) { - console.log('Vuex module: ibc.core.connection.v1 initialized!') - if (rootGetters['common/env/client']) { - rootGetters['common/env/client'].on('newblock', () => { - dispatch('StoreUpdate') - }) - } - }, - resetState({ commit }) { - commit('RESET_STATE') - }, - unsubscribe({ commit }, subscription) { - commit('UNSUBSCRIBE', subscription) - }, - async StoreUpdate({ state, dispatch }) { - state._Subscriptions.forEach(async (subscription) => { - try { - const sub=JSON.parse(subscription) - await dispatch(sub.action, sub.payload) - }catch(e) { - throw new Error('Subscriptions: ' + e.message) - } - }) - }, - - - - - - - async QueryConnection({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreConnectionV1.query.queryConnection( key.connection_id)).data - - - commit('QUERY', { query: 'Connection', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnection', payload: { options: { all }, params: {...key},query }}) - return getters['getConnection']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnection API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConnections({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreConnectionV1.query.queryConnections(query ?? undefined)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await client.IbcCoreConnectionV1.query.queryConnections({...query ?? {}, 'pagination.key':( value).pagination.next_key} as any)).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'Connections', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnections', payload: { options: { all }, params: {...key},query }}) - return getters['getConnections']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnections API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryClientConnections({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreConnectionV1.query.queryClientConnections( key.client_id)).data - - - commit('QUERY', { query: 'ClientConnections', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryClientConnections', payload: { options: { all }, params: {...key},query }}) - return getters['getClientConnections']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryClientConnections API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConnectionClientState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreConnectionV1.query.queryConnectionClientState( key.connection_id)).data - - - commit('QUERY', { query: 'ConnectionClientState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnectionClientState', payload: { options: { all }, params: {...key},query }}) - return getters['getConnectionClientState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnectionClientState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConnectionConsensusState({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreConnectionV1.query.queryConnectionConsensusState( key.connection_id, key.revision_number, key.revision_height)).data - - - commit('QUERY', { query: 'ConnectionConsensusState', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnectionConsensusState', payload: { options: { all }, params: {...key},query }}) - return getters['getConnectionConsensusState']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnectionConsensusState API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - - async QueryConnectionParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const client = initClient(rootGetters); - let value= (await client.IbcCoreConnectionV1.query.queryConnectionParams()).data - - - commit('QUERY', { query: 'ConnectionParams', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryConnectionParams', payload: { options: { all }, params: {...key},query }}) - return getters['getConnectionParams']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryConnectionParams API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - } -} \ No newline at end of file diff --git a/vue/src/store/generated/index.ts b/vue/src/store/generated/index.ts deleted file mode 100644 index 03e6f3dc..00000000 --- a/vue/src/store/generated/index.ts +++ /dev/null @@ -1,83 +0,0 @@ -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import FairyringKeyshare from './fairyring.keyshare' -import FairyringPep from './fairyring.pep' -import IbcApplicationsInterchainAccountsControllerV1 from './ibc.applications.interchain_accounts.controller.v1' -import IbcApplicationsInterchainAccountsHostV1 from './ibc.applications.interchain_accounts.host.v1' -import IbcApplicationsTransferV1 from './ibc.applications.transfer.v1' -import IbcCoreChannelV1 from './ibc.core.channel.v1' -import IbcCoreClientV1 from './ibc.core.client.v1' -import IbcCoreConnectionV1 from './ibc.core.connection.v1' -import CosmosAuthV1Beta1 from './cosmos.auth.v1beta1' -import CosmosAuthzV1Beta1 from './cosmos.authz.v1beta1' -import CosmosBankV1Beta1 from './cosmos.bank.v1beta1' -import CosmosBaseNodeV1Beta1 from './cosmos.base.node.v1beta1' -import CosmosBaseTendermintV1Beta1 from './cosmos.base.tendermint.v1beta1' -import CosmosConsensusV1 from './cosmos.consensus.v1' -import CosmosCrisisV1Beta1 from './cosmos.crisis.v1beta1' -import CosmosDistributionV1Beta1 from './cosmos.distribution.v1beta1' -import CosmosEvidenceV1Beta1 from './cosmos.evidence.v1beta1' -import CosmosFeegrantV1Beta1 from './cosmos.feegrant.v1beta1' -import CosmosGovV1 from './cosmos.gov.v1' -import CosmosGovV1Beta1 from './cosmos.gov.v1beta1' -import CosmosGroupV1 from './cosmos.group.v1' -import CosmosMintV1Beta1 from './cosmos.mint.v1beta1' -import CosmosNftV1Beta1 from './cosmos.nft.v1beta1' -import CosmosParamsV1Beta1 from './cosmos.params.v1beta1' -import CosmosSlashingV1Beta1 from './cosmos.slashing.v1beta1' -import CosmosStakingV1Beta1 from './cosmos.staking.v1beta1' -import CosmosTxV1Beta1 from './cosmos.tx.v1beta1' -import CosmosUpgradeV1Beta1 from './cosmos.upgrade.v1beta1' -import CosmosVestingV1Beta1 from './cosmos.vesting.v1beta1' - - -export default { - FairyringKeyshare: load(FairyringKeyshare, 'fairyring.keyshare'), - FairyringPep: load(FairyringPep, 'fairyring.pep'), - IbcApplicationsInterchainAccountsControllerV1: load(IbcApplicationsInterchainAccountsControllerV1, 'ibc.applications.interchain_accounts.controller.v1'), - IbcApplicationsInterchainAccountsHostV1: load(IbcApplicationsInterchainAccountsHostV1, 'ibc.applications.interchain_accounts.host.v1'), - IbcApplicationsTransferV1: load(IbcApplicationsTransferV1, 'ibc.applications.transfer.v1'), - IbcCoreChannelV1: load(IbcCoreChannelV1, 'ibc.core.channel.v1'), - IbcCoreClientV1: load(IbcCoreClientV1, 'ibc.core.client.v1'), - IbcCoreConnectionV1: load(IbcCoreConnectionV1, 'ibc.core.connection.v1'), - CosmosAuthV1Beta1: load(CosmosAuthV1Beta1, 'cosmos.auth.v1beta1'), - CosmosAuthzV1Beta1: load(CosmosAuthzV1Beta1, 'cosmos.authz.v1beta1'), - CosmosBankV1Beta1: load(CosmosBankV1Beta1, 'cosmos.bank.v1beta1'), - CosmosBaseNodeV1Beta1: load(CosmosBaseNodeV1Beta1, 'cosmos.base.node.v1beta1'), - CosmosBaseTendermintV1Beta1: load(CosmosBaseTendermintV1Beta1, 'cosmos.base.tendermint.v1beta1'), - CosmosConsensusV1: load(CosmosConsensusV1, 'cosmos.consensus.v1'), - CosmosCrisisV1Beta1: load(CosmosCrisisV1Beta1, 'cosmos.crisis.v1beta1'), - CosmosDistributionV1Beta1: load(CosmosDistributionV1Beta1, 'cosmos.distribution.v1beta1'), - CosmosEvidenceV1Beta1: load(CosmosEvidenceV1Beta1, 'cosmos.evidence.v1beta1'), - CosmosFeegrantV1Beta1: load(CosmosFeegrantV1Beta1, 'cosmos.feegrant.v1beta1'), - CosmosGovV1: load(CosmosGovV1, 'cosmos.gov.v1'), - CosmosGovV1Beta1: load(CosmosGovV1Beta1, 'cosmos.gov.v1beta1'), - CosmosGroupV1: load(CosmosGroupV1, 'cosmos.group.v1'), - CosmosMintV1Beta1: load(CosmosMintV1Beta1, 'cosmos.mint.v1beta1'), - CosmosNftV1Beta1: load(CosmosNftV1Beta1, 'cosmos.nft.v1beta1'), - CosmosParamsV1Beta1: load(CosmosParamsV1Beta1, 'cosmos.params.v1beta1'), - CosmosSlashingV1Beta1: load(CosmosSlashingV1Beta1, 'cosmos.slashing.v1beta1'), - CosmosStakingV1Beta1: load(CosmosStakingV1Beta1, 'cosmos.staking.v1beta1'), - CosmosTxV1Beta1: load(CosmosTxV1Beta1, 'cosmos.tx.v1beta1'), - CosmosUpgradeV1Beta1: load(CosmosUpgradeV1Beta1, 'cosmos.upgrade.v1beta1'), - CosmosVestingV1Beta1: load(CosmosVestingV1Beta1, 'cosmos.vesting.v1beta1'), - -} - - -function load(mod, fullns) { - return function init(store) { - if (store.hasModule([fullns])) { - throw new Error('Duplicate module name detected: '+ fullns) - }else{ - store.registerModule([fullns], mod) - store.subscribe((mutation) => { - if (mutation.type == 'common/env/INITIALIZE_WS_COMPLETE') { - store.dispatch(fullns+ '/init', null, { - root: true - }) - } - }) - } - } -} \ No newline at end of file diff --git a/vue/src/store/generated/local-check.js b/vue/src/store/generated/local-check.js deleted file mode 100755 index 1cb66c57..00000000 --- a/vue/src/store/generated/local-check.js +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-env node */ -const pkgjson = require("./package.json"); - -for (let pkg in pkgjson.dependencies) { - if (pkgjson.dependencies[pkg].startsWith("file:")) { - console.error( - "\x1b[31m%s\x1b[0m", - `Package '${pkg}' located at '${pkgjson.dependencies[pkg].replace( - "file:", - "" - )}' needs to be published and your package.json file updated before publishing.` - ); - process.exit(1) - } -} \ No newline at end of file diff --git a/vue/src/store/generated/package.json b/vue/src/store/generated/package.json deleted file mode 100644 index 812099a2..00000000 --- a/vue/src/store/generated/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "author": "Ignite Codegen ", - "dependencies": { - "buffer": "^6.0.3", - "fairyring-client-ts": "file:../../../../ts-client" - }, - "description": "Autogenerated Vuex Stores", - "devDependencies": { - "typescript": "^4.8.4" - }, - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "main": "./lib/index.js", - "name": "fairyring-vuex", - "peerDependencies": { - "@cosmjs/proto-signing": "0.27.0", - "@cosmjs/stargate": "0.27.0", - "vue": "3.2.31" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "build": "tsc", - "postinstall": "node postinstall.js", - "prepublishOnly": "node local-check.js && tsc" - }, - "version": "0.0.1" -} diff --git a/vue/src/store/generated/postinstall.js b/vue/src/store/generated/postinstall.js deleted file mode 100755 index 4ce12284..00000000 --- a/vue/src/store/generated/postinstall.js +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-env node */ -const pkgjson = require("./package.json"); -var exec = require("child_process").exec; - -for (let pkg in pkgjson.dependencies) { - if (pkgjson.dependencies[pkg].startsWith("file:")) { - exec(`cd ./node_modules/${pkg} && npm install`); - } -} \ No newline at end of file diff --git a/vue/src/store/generated/readme.md b/vue/src/store/generated/readme.md deleted file mode 100644 index a9a292f4..00000000 --- a/vue/src/store/generated/readme.md +++ /dev/null @@ -1 +0,0 @@ -THIS FOLDER IS GENERATED AUTOMATICALLY. DO NOT MODIFY. diff --git a/vue/src/store/generated/tsconfig.json b/vue/src/store/generated/tsconfig.json deleted file mode 100755 index 87d99d67..00000000 --- a/vue/src/store/generated/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "target": "es2020", - "module": "es2020", /* Specify the root folder within your source files. */ - "moduleResolution": "node", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./lib", - "esModuleInterop": true, - "strict": false, - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } -} diff --git a/vue/src/store/index.ts b/vue/src/store/index.ts deleted file mode 100644 index 5a675353..00000000 --- a/vue/src/store/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { createStore } from 'vuex' - -import init from './config' - -const store = createStore({ - state() { - return {} - }, - mutations: {}, - actions: {} -}) -init(store) -export default store diff --git a/vue/src/views/Data.vue b/vue/src/views/Data.vue deleted file mode 100644 index b51e518c..00000000 --- a/vue/src/views/Data.vue +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/vue/src/views/Portfolio.vue b/vue/src/views/Portfolio.vue deleted file mode 100644 index 82b3e7a6..00000000 --- a/vue/src/views/Portfolio.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - - - diff --git a/vue/vite.config.ts b/vue/vite.config.ts deleted file mode 100644 index 6331d30a..00000000 --- a/vue/vite.config.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { nodeResolve } from '@rollup/plugin-node-resolve' -import vue from '@vitejs/plugin-vue' -import { Buffer } from 'buffer' -import { defineConfig } from 'vite' -import { dynamicImport } from 'vite-plugin-dynamic-import' -import envCompatible from 'vite-plugin-env-compatible' - -// https://vitejs.dev/config/ -export default defineConfig({ - define: { - global: { - Buffer: Buffer - } - }, - server: { - watch: { - ignored: [ - '!**/node_modules/@starport/vue/src/**', - '!**/node_modules/@starport/vuex/src/**' - ] - } - }, - plugins: [vue(), nodeResolve(), dynamicImport(), envCompatible()], - optimizeDeps: { - include: [ - 'gradient-avatar', - 'crypto-js', - 'axios', - 'qrcode', - '@cosmjs/encoding' - ] - } -})