From 9d18705ad5b276f5c5dda22983de3772ed003c20 Mon Sep 17 00:00:00 2001 From: David Uhlmann Date: Tue, 26 Jul 2022 03:56:34 +1000 Subject: [PATCH] #96 --- .env | 9 + package-lock.json | 1550 ++++- package.json | 11 +- scripts/update-generated-files.sh | 20 + src/lib/web3/api.ts | 73 + .../duality/duality.duality/module/rest.ts | 544 ++ .../cosmos/base/query/v1beta1/pagination.ts | 328 + .../module/types/duality/genesis.ts | 134 + .../module/types/duality/params.ts | 56 + .../module/types/duality/query.ts | 1235 ++++ .../module/types/duality/share.ts | 209 + .../module/types/duality/tick.ts | 190 + .../module/types/duality/tx.ts | 560 ++ .../module/types/gogoproto/gogo.ts | 2 + .../module/types/google/api/annotations.ts | 2 + .../module/types/google/api/http.ts | 706 +++ .../types/google/protobuf/descriptor.ts | 5314 +++++++++++++++++ .../duality/duality.duality/package.json | 18 + src/lib/web3/generated/readme.md | 1 + tsconfig.json | 3 +- 20 files changed, 10911 insertions(+), 54 deletions(-) create mode 100644 scripts/update-generated-files.sh create mode 100755 src/lib/web3/api.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/rest.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/cosmos/base/query/v1beta1/pagination.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/duality/genesis.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/duality/params.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/duality/query.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/duality/share.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/duality/tick.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/duality/tx.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/gogoproto/gogo.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/google/api/annotations.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/google/api/http.ts create mode 100644 src/lib/web3/generated/duality/duality.duality/module/types/google/protobuf/descriptor.ts create mode 100755 src/lib/web3/generated/duality/duality.duality/package.json create mode 100644 src/lib/web3/generated/readme.md diff --git a/.env b/.env index b9738d42a..c60677a55 100644 --- a/.env +++ b/.env @@ -8,6 +8,15 @@ # link: https://create-react-app.dev/docs/adding-custom-environment-variables/#expanding-environment-variables-in-env REACT_APP__APP_VERSION=$npm_package_version +# disable source-maps. @cosmjs packages do not publish source code on npm +# so attempting to generate them will cause hundreds of errorrs. +GENERATE_SOURCEMAP=false + +# Chain Info +REACT_APP__RPC_API=http://localhost:26657 +REACT_APP__REST_API=http://localhost:1317 +REACT_APP__WEBSOCKET_URL=ws://localhost:26657/websocket + # Contract Info REACT_APP__CHAIN_ID=31337 REACT_APP__CONTRACT_ADDRESS__DUALITY_CORE=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0c0a0ff37..b3943ce4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "duality-webapp", "version": "0.1.6", "dependencies": { + "@cosmjs/launchpad": "^0.27.1", + "@cosmjs/proto-signing": "^0.27.1", + "@cosmjs/stargate": "^0.27.1", "@floating-ui/react-dom": "^0.6.3", "@reach/dialog": "^0.17.0", "buffer": "^6.0.3", @@ -50,6 +53,11 @@ "engines": { "node": "^16.14.2", "npm": "^8.5.0" + }, + "peerDependencies": { + "crypto": "npm:crypto-browserify@^3.12.0", + "path": "npm:path-browserify@^1.0.1", + "stream": "npm:stream-browserify@3.0.0" } }, "node_modules/@ampproject/remapping": { @@ -2002,6 +2010,226 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@confio/ics23": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz", + "integrity": "sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==", + "dependencies": { + "@noble/hashes": "^1.0.0", + "protobufjs": "^6.8.8" + } + }, + "node_modules/@cosmjs/amino": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.1.tgz", + "integrity": "sha512-w56ar/nK9+qlvWDpBPRmD0Blk2wfkkLqRi1COs1x7Ll1LF0AtkIBUjbRKplENLbNovK0T3h+w8bHiFm+GBGQOA==", + "dependencies": { + "@cosmjs/crypto": "0.27.1", + "@cosmjs/encoding": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/utils": "0.27.1" + } + }, + "node_modules/@cosmjs/crypto": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.1.tgz", + "integrity": "sha512-vbcxwSt99tIYJg8Spp00wc3zx72qx+pY3ozGuBN8gAvySnagK9dQ/jHwtWQWdammmdD6oW+75WfIHZ+gNa+Ybg==", + "dependencies": { + "@cosmjs/encoding": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/utils": "0.27.1", + "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.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/@cosmjs/encoding": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.27.1.tgz", + "integrity": "sha512-rayLsA0ojHeniaRfWWcqSsrE/T1rl1gl0OXVNtXlPwLJifKBeLEefGbOUiAQaT0wgJ8VNGBazVtAZBpJidfDhw==", + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "node_modules/@cosmjs/json-rpc": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.27.1.tgz", + "integrity": "sha512-AKvsllGr6oN5kiroatIeIIxRdCFetLd8LCWV04RRNkoJ2OefDNb46VlWEQ+gI3ay5GgfVjB9qAcfvbJyrcEv+A==", + "dependencies": { + "@cosmjs/stream": "0.27.1", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/launchpad": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.27.1.tgz", + "integrity": "sha512-DcFwGD/z5PK8CzO2sojDxa+Be9EIEtRZb2YawgVnw2Ht/p5FlNv+OVo8qlishpBdalXEN7FvQ1dVeDFEe9TuJw==", + "dependencies": { + "@cosmjs/amino": "0.27.1", + "@cosmjs/crypto": "0.27.1", + "@cosmjs/encoding": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/utils": "0.27.1", + "axios": "^0.21.2", + "fast-deep-equal": "^3.1.3" + } + }, + "node_modules/@cosmjs/math": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.1.tgz", + "integrity": "sha512-cHWVjmfIjtRc7f80n7x+J5k8pe+vTVTQ0lA82tIxUgqUvgS6rogPP/TmGtTiZ4+NxWxd11DUISY6gVpr18/VNQ==", + "dependencies": { + "bn.js": "^5.2.0" + } + }, + "node_modules/@cosmjs/math/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/@cosmjs/proto-signing": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.27.1.tgz", + "integrity": "sha512-t7/VvQivMdM1KgKWai/9ZCEcGFXJtr9Xo0hGcPLTn9wGkh9tmOsUXINYVMsf5D/jWIm1MDPbGCYfdb9V1Od4hw==", + "dependencies": { + "@cosmjs/amino": "0.27.1", + "@cosmjs/crypto": "0.27.1", + "@cosmjs/math": "0.27.1", + "cosmjs-types": "^0.4.0", + "long": "^4.0.0", + "protobufjs": "~6.10.2" + } + }, + "node_modules/@cosmjs/proto-signing/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/@cosmjs/proto-signing/node_modules/protobufjs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.3.tgz", + "integrity": "sha512-yvAslS0hNdBhlSKckI4R1l7wunVilX66uvrjzE4MimiAt7/qw1nLpMhZrn/ObuUTM/c3Xnfl01LYMdcSJe6dwg==", + "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/@cosmjs/socket": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.27.1.tgz", + "integrity": "sha512-bKCRsaSXh/TA7efxVCogzS2K3cgC40Ge2itFYmTfgpOE+++52FchCblVCsCYwMNDLS497RP4P0GbeC1VEBToMA==", + "dependencies": { + "@cosmjs/stream": "0.27.1", + "isomorphic-ws": "^4.0.1", + "ws": "^7", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stargate": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.27.1.tgz", + "integrity": "sha512-7hAIyNd6NbhQA51w9mPVyMYw515Hpj0o7SXMaqbc7nxs3hkJNMONQ9RakyMm0U/WeCd6ObcSaPEcdkqbfkc+mg==", + "dependencies": { + "@confio/ics23": "^0.6.3", + "@cosmjs/amino": "0.27.1", + "@cosmjs/encoding": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/proto-signing": "0.27.1", + "@cosmjs/stream": "0.27.1", + "@cosmjs/tendermint-rpc": "0.27.1", + "@cosmjs/utils": "0.27.1", + "cosmjs-types": "^0.4.0", + "long": "^4.0.0", + "protobufjs": "~6.10.2", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stargate/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/@cosmjs/stargate/node_modules/protobufjs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.3.tgz", + "integrity": "sha512-yvAslS0hNdBhlSKckI4R1l7wunVilX66uvrjzE4MimiAt7/qw1nLpMhZrn/ObuUTM/c3Xnfl01LYMdcSJe6dwg==", + "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/@cosmjs/stream": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.27.1.tgz", + "integrity": "sha512-cEyEAVfXEyuUpKYBeEJrOj8Dp/c+M6a0oGJHxvDdhP5gSsaeCPgQXrh7qZFBiUfu3Brmqd+e/bKZm+068l9bBw==", + "dependencies": { + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.27.1.tgz", + "integrity": "sha512-eN1NyBYIiFutDNleEaTfvIJ3S3KA1gP45UHaLhSETm8KyiaUqg/b0Mj6sp7J3h4BhgwLq2zn/TDtIn0k5luedg==", + "dependencies": { + "@cosmjs/crypto": "0.27.1", + "@cosmjs/encoding": "0.27.1", + "@cosmjs/json-rpc": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/socket": "0.27.1", + "@cosmjs/stream": "0.27.1", + "axios": "^0.21.2", + "readonly-date": "^1.0.0", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/utils": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.1.tgz", + "integrity": "sha512-VG7QPDiMUzVPxRdJahDV8PXxVdnuAHiIuG56hldV4yPnOz/si/DLNd7VAUUA5923b6jS1Hhev0Hr6AhEkcxBMg==" + }, "node_modules/@csstools/normalize.css": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-12.0.0.tgz", @@ -4695,6 +4923,17 @@ "integrity": "sha512-nkalE/f1RvRGChwBnEIoBfSEYOXnCRdleKuv6+lePbMDrMZXeDQnqak5XDOeBgrPPyPfAdcCu/B5z+v3VhplGg==", "dev": true }, + "node_modules/@noble/hashes": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", + "integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -4789,6 +5028,60 @@ "node": ">= 8" } }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "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": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, "node_modules/@reach/dialog": { "version": "0.17.0", "resolved": "https://registry.npmjs.org/@reach/dialog/-/dialog-0.17.0.tgz", @@ -5784,6 +6077,11 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, "node_modules/@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", @@ -5793,8 +6091,7 @@ "node_modules/@types/node": { "version": "16.11.27", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.27.tgz", - "integrity": "sha512-C1pD3kgLoZ56Uuy5lhfOxie4aZlA3UMGLX9rXteq4WitEZH6Rl80mwactt9QG0w0gLFlN/kLBTFnGXtDVWvWQw==", - "dev": true + "integrity": "sha512-C1pD3kgLoZ56Uuy5lhfOxie4aZlA3UMGLX9rXteq4WitEZH6Rl80mwactt9QG0w0gLFlN/kLBTFnGXtDVWvWQw==" }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -6712,6 +7009,18 @@ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" }, + "node_modules/asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "peer": true, + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, "node_modules/ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -6805,6 +7114,14 @@ "node": ">=4" } }, + "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/axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -7190,6 +7507,22 @@ "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/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -7309,6 +7642,102 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "peer": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "peer": true, + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "peer": true, + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "peer": true, + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-rsa/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "peer": true + }, + "node_modules/browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "peer": true, + "dependencies": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "node_modules/browserify-sign/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "peer": true + }, + "node_modules/browserify-sign/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" + } + ], + "peer": true + }, "node_modules/browserslist": { "version": "4.20.2", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", @@ -7376,6 +7805,12 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "peer": true + }, "node_modules/builtin-modules": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", @@ -7579,6 +8014,15 @@ "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", "dev": true }, + "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/cjs-module-lexer": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", @@ -7994,6 +8438,50 @@ "node": ">=10" } }, + "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/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "peer": true, + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "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/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -8008,6 +8496,29 @@ "node": ">= 8" } }, + "node_modules/crypto": { + "name": "crypto-browserify", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "peer": true, + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, "node_modules/crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -8550,7 +9061,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, "dependencies": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" @@ -8586,6 +9096,16 @@ "node": ">= 0.6" } }, + "node_modules/des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "peer": true, + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "node_modules/destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", @@ -8676,6 +9196,17 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "peer": true, + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -9900,6 +10431,16 @@ "node": ">=0.8.x" } }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "peer": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -10227,8 +10768,7 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-glob": { "version": "3.2.11", @@ -10462,7 +11002,6 @@ "version": "1.14.9", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", - "dev": true, "funding": [ { "type": "individual", @@ -10733,8 +11272,7 @@ "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 + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/functional-red-black-tree": { "version": "1.0.1", @@ -10773,7 +11311,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -10919,6 +11456,20 @@ "node": ">=4" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -10976,7 +11527,6 @@ "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" }, @@ -11006,7 +11556,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.1" }, @@ -11018,7 +11567,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -11041,6 +11589,38 @@ "url": "https://github.com/sponsors/ljharb" } }, + "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-base/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/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -11864,6 +12444,14 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "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/istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", @@ -16243,6 +16831,19 @@ "node": ">= 0.8.0" } }, + "node_modules/libsodium": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", + "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" + }, + "node_modules/libsodium-wrappers": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", + "integrity": "sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg==", + "dependencies": { + "libsodium": "^0.7.0" + } + }, "node_modules/lilconfig": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz", @@ -16556,6 +17157,11 @@ "node": ">=8" } }, + "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/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -16639,6 +17245,16 @@ "tmpl": "1.0.5" } }, + "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/mdn-data": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", @@ -16709,6 +17325,19 @@ "node": ">=8.6" } }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "peer": true, + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -17054,7 +17683,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, "engines": { "node": ">= 0.4" } @@ -17329,6 +17957,19 @@ "node": ">=6" } }, + "node_modules/parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "peer": true, + "dependencies": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -17372,6 +18013,13 @@ "tslib": "^2.0.3" } }, + "node_modules/path": { + "name": "path-browserify", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "peer": true + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -17420,6 +18068,21 @@ "node": ">=8" } }, + "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/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -18885,6 +19548,31 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/protobufjs": { + "version": "6.11.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", + "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", + "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/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -18913,6 +19601,20 @@ "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", "dev": true }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "peer": true, + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -18988,11 +19690,20 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, "dependencies": { "safe-buffer": "^5.1.0" } }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "peer": true, + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -20149,7 +20860,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -20171,6 +20881,11 @@ "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/recursive-readdir": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", @@ -20525,6 +21240,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "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.70.2", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.70.2.tgz", @@ -20634,14 +21358,12 @@ "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sanitize.css": { "version": "13.0.0", @@ -20921,6 +21643,18 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, + "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/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -21193,11 +21927,21 @@ "node": ">= 0.6" } }, + "node_modules/stream": { + "name": "stream-browserify", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "peer": true, + "dependencies": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, "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==", - "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -21206,7 +21950,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -21575,6 +22318,14 @@ "boolbase": "~1.0.0" } }, + "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/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -22180,8 +22931,7 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "node_modules/util.promisify": { "version": "1.0.1", @@ -23136,7 +23886,6 @@ "version": "7.5.9", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", - "dev": true, "engines": { "node": ">=8.3.0" }, @@ -23165,6 +23914,15 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": 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" + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -24593,6 +25351,224 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@confio/ics23": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz", + "integrity": "sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==", + "requires": { + "@noble/hashes": "^1.0.0", + "protobufjs": "^6.8.8" + } + }, + "@cosmjs/amino": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.1.tgz", + "integrity": "sha512-w56ar/nK9+qlvWDpBPRmD0Blk2wfkkLqRi1COs1x7Ll1LF0AtkIBUjbRKplENLbNovK0T3h+w8bHiFm+GBGQOA==", + "requires": { + "@cosmjs/crypto": "0.27.1", + "@cosmjs/encoding": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/utils": "0.27.1" + } + }, + "@cosmjs/crypto": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.1.tgz", + "integrity": "sha512-vbcxwSt99tIYJg8Spp00wc3zx72qx+pY3ozGuBN8gAvySnagK9dQ/jHwtWQWdammmdD6oW+75WfIHZ+gNa+Ybg==", + "requires": { + "@cosmjs/encoding": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/utils": "0.27.1", + "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.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + } + } + }, + "@cosmjs/encoding": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.27.1.tgz", + "integrity": "sha512-rayLsA0ojHeniaRfWWcqSsrE/T1rl1gl0OXVNtXlPwLJifKBeLEefGbOUiAQaT0wgJ8VNGBazVtAZBpJidfDhw==", + "requires": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "@cosmjs/json-rpc": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.27.1.tgz", + "integrity": "sha512-AKvsllGr6oN5kiroatIeIIxRdCFetLd8LCWV04RRNkoJ2OefDNb46VlWEQ+gI3ay5GgfVjB9qAcfvbJyrcEv+A==", + "requires": { + "@cosmjs/stream": "0.27.1", + "xstream": "^11.14.0" + } + }, + "@cosmjs/launchpad": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.27.1.tgz", + "integrity": "sha512-DcFwGD/z5PK8CzO2sojDxa+Be9EIEtRZb2YawgVnw2Ht/p5FlNv+OVo8qlishpBdalXEN7FvQ1dVeDFEe9TuJw==", + "requires": { + "@cosmjs/amino": "0.27.1", + "@cosmjs/crypto": "0.27.1", + "@cosmjs/encoding": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/utils": "0.27.1", + "axios": "^0.21.2", + "fast-deep-equal": "^3.1.3" + } + }, + "@cosmjs/math": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.1.tgz", + "integrity": "sha512-cHWVjmfIjtRc7f80n7x+J5k8pe+vTVTQ0lA82tIxUgqUvgS6rogPP/TmGtTiZ4+NxWxd11DUISY6gVpr18/VNQ==", + "requires": { + "bn.js": "^5.2.0" + }, + "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + } + } + }, + "@cosmjs/proto-signing": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.27.1.tgz", + "integrity": "sha512-t7/VvQivMdM1KgKWai/9ZCEcGFXJtr9Xo0hGcPLTn9wGkh9tmOsUXINYVMsf5D/jWIm1MDPbGCYfdb9V1Od4hw==", + "requires": { + "@cosmjs/amino": "0.27.1", + "@cosmjs/crypto": "0.27.1", + "@cosmjs/math": "0.27.1", + "cosmjs-types": "^0.4.0", + "long": "^4.0.0", + "protobufjs": "~6.10.2" + }, + "dependencies": { + "@types/node": { + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + }, + "protobufjs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.3.tgz", + "integrity": "sha512-yvAslS0hNdBhlSKckI4R1l7wunVilX66uvrjzE4MimiAt7/qw1nLpMhZrn/ObuUTM/c3Xnfl01LYMdcSJe6dwg==", + "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" + } + } + } + }, + "@cosmjs/socket": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.27.1.tgz", + "integrity": "sha512-bKCRsaSXh/TA7efxVCogzS2K3cgC40Ge2itFYmTfgpOE+++52FchCblVCsCYwMNDLS497RP4P0GbeC1VEBToMA==", + "requires": { + "@cosmjs/stream": "0.27.1", + "isomorphic-ws": "^4.0.1", + "ws": "^7", + "xstream": "^11.14.0" + } + }, + "@cosmjs/stargate": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.27.1.tgz", + "integrity": "sha512-7hAIyNd6NbhQA51w9mPVyMYw515Hpj0o7SXMaqbc7nxs3hkJNMONQ9RakyMm0U/WeCd6ObcSaPEcdkqbfkc+mg==", + "requires": { + "@confio/ics23": "^0.6.3", + "@cosmjs/amino": "0.27.1", + "@cosmjs/encoding": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/proto-signing": "0.27.1", + "@cosmjs/stream": "0.27.1", + "@cosmjs/tendermint-rpc": "0.27.1", + "@cosmjs/utils": "0.27.1", + "cosmjs-types": "^0.4.0", + "long": "^4.0.0", + "protobufjs": "~6.10.2", + "xstream": "^11.14.0" + }, + "dependencies": { + "@types/node": { + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + }, + "protobufjs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.3.tgz", + "integrity": "sha512-yvAslS0hNdBhlSKckI4R1l7wunVilX66uvrjzE4MimiAt7/qw1nLpMhZrn/ObuUTM/c3Xnfl01LYMdcSJe6dwg==", + "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" + } + } + } + }, + "@cosmjs/stream": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.27.1.tgz", + "integrity": "sha512-cEyEAVfXEyuUpKYBeEJrOj8Dp/c+M6a0oGJHxvDdhP5gSsaeCPgQXrh7qZFBiUfu3Brmqd+e/bKZm+068l9bBw==", + "requires": { + "xstream": "^11.14.0" + } + }, + "@cosmjs/tendermint-rpc": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.27.1.tgz", + "integrity": "sha512-eN1NyBYIiFutDNleEaTfvIJ3S3KA1gP45UHaLhSETm8KyiaUqg/b0Mj6sp7J3h4BhgwLq2zn/TDtIn0k5luedg==", + "requires": { + "@cosmjs/crypto": "0.27.1", + "@cosmjs/encoding": "0.27.1", + "@cosmjs/json-rpc": "0.27.1", + "@cosmjs/math": "0.27.1", + "@cosmjs/socket": "0.27.1", + "@cosmjs/stream": "0.27.1", + "axios": "^0.21.2", + "readonly-date": "^1.0.0", + "xstream": "^11.14.0" + } + }, + "@cosmjs/utils": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.1.tgz", + "integrity": "sha512-VG7QPDiMUzVPxRdJahDV8PXxVdnuAHiIuG56hldV4yPnOz/si/DLNd7VAUUA5923b6jS1Hhev0Hr6AhEkcxBMg==" + }, "@csstools/normalize.css": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-12.0.0.tgz", @@ -26502,6 +27478,11 @@ "integrity": "sha512-nkalE/f1RvRGChwBnEIoBfSEYOXnCRdleKuv6+lePbMDrMZXeDQnqak5XDOeBgrPPyPfAdcCu/B5z+v3VhplGg==", "dev": true }, + "@noble/hashes": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", + "integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==" + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -26553,6 +27534,60 @@ } } }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "@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": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "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": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, "@reach/dialog": { "version": "0.17.0", "resolved": "https://registry.npmjs.org/@reach/dialog/-/dialog-0.17.0.tgz", @@ -27307,6 +28342,11 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, "@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", @@ -27316,8 +28356,7 @@ "@types/node": { "version": "16.11.27", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.27.tgz", - "integrity": "sha512-C1pD3kgLoZ56Uuy5lhfOxie4aZlA3UMGLX9rXteq4WitEZH6Rl80mwactt9QG0w0gLFlN/kLBTFnGXtDVWvWQw==", - "dev": true + "integrity": "sha512-C1pD3kgLoZ56Uuy5lhfOxie4aZlA3UMGLX9rXteq4WitEZH6Rl80mwactt9QG0w0gLFlN/kLBTFnGXtDVWvWQw==" }, "@types/parse-json": { "version": "4.0.0", @@ -28035,6 +29074,18 @@ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "peer": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, "ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -28094,6 +29145,14 @@ "integrity": "sha512-gd1kmb21kwNuWr6BQz8fv6GNECPBnUasepcoLbekws23NVBLODdsClRZ+bQ8+9Uomf3Sm3+Vwn0oYG9NvwnJCw==", "dev": true }, + "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" + } + }, "axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -28388,6 +29447,24 @@ "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==" + } + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -28497,6 +29574,92 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "peer": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "peer": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "peer": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "peer": true, + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "peer": true + } + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "peer": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "peer": true + }, + "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==", + "peer": true + } + } + }, "browserslist": { "version": "4.20.2", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", @@ -28534,6 +29697,12 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "peer": true + }, "builtin-modules": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", @@ -28676,6 +29845,15 @@ "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", "dev": true }, + "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" + } + }, "cjs-module-lexer": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", @@ -28997,6 +30175,50 @@ "yaml": "^1.10.0" } }, + "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" + } + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "peer": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "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" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -29008,6 +30230,25 @@ "which": "^2.0.1" } }, + "crypto": { + "version": "npm:crypto-browserify@3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "peer": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, "crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -29395,7 +30636,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, "requires": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" @@ -29419,6 +30659,16 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "peer": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", @@ -29492,6 +30742,17 @@ "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==", "dev": true }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "peer": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -30415,6 +31676,16 @@ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "peer": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, "execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -30671,8 +31942,7 @@ "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { "version": "3.2.11", @@ -30860,8 +32130,7 @@ "follow-redirects": { "version": "1.14.9", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", - "dev": true + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" }, "fork-ts-checker-webpack-plugin": { "version": "6.5.1", @@ -31039,8 +32308,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", @@ -31070,7 +32338,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -31176,6 +32443,14 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "requires": { + "define-properties": "^1.1.3" + } + }, "globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -31221,7 +32496,6 @@ "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" } @@ -31242,7 +32516,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, "requires": { "get-intrinsic": "^1.1.1" } @@ -31250,8 +32523,7 @@ "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, "has-tostringtag": { "version": "1.0.0", @@ -31262,6 +32534,23 @@ "has-symbols": "^1.0.2" } }, + "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" + }, + "dependencies": { + "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==" + } + } + }, "hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -31849,6 +33138,12 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "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": {} + }, "istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", @@ -35237,6 +36532,19 @@ "type-check": "~0.4.0" } }, + "libsodium": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", + "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" + }, + "libsodium-wrappers": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", + "integrity": "sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg==", + "requires": { + "libsodium": "^0.7.0" + } + }, "lilconfig": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz", @@ -35470,6 +36778,11 @@ } } }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -35537,6 +36850,16 @@ "tmpl": "1.0.5" } }, + "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" + } + }, "mdn-data": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", @@ -35592,6 +36915,16 @@ "picomatch": "^2.3.1" } }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "peer": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -35845,8 +37178,7 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, "object.assign": { "version": "4.1.2", @@ -36040,6 +37372,19 @@ "callsites": "^3.0.0" } }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "peer": true, + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -36074,6 +37419,12 @@ "tslib": "^2.0.3" } }, + "path": { + "version": "npm:path-browserify@1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "peer": true + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -36110,6 +37461,18 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "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" + } + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -37057,6 +38420,26 @@ } } }, + "protobufjs": { + "version": "6.11.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", + "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", + "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" + } + }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -37081,6 +38464,20 @@ "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", "dev": true }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "peer": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -37123,11 +38520,20 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, "requires": { "safe-buffer": "^5.1.0" } }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "peer": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -38005,7 +39411,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -38021,6 +39426,11 @@ "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==" + }, "recursive-readdir": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", @@ -38283,6 +39693,15 @@ "glob": "^7.1.3" } }, + "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.70.2", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.70.2.tgz", @@ -38362,14 +39781,12 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sanitize.css": { "version": "13.0.0", @@ -38590,6 +40007,15 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, + "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" + } + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -38806,11 +40232,20 @@ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", "dev": true }, + "stream": { + "version": "npm:stream-browserify@3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "peer": true, + "requires": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, "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==", - "dev": true, "requires": { "safe-buffer": "~5.2.0" }, @@ -38818,8 +40253,7 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" } } }, @@ -39096,6 +40530,11 @@ } } }, + "symbol-observable": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", + "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==" + }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -39534,8 +40973,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "util.promisify": { "version": "1.0.1", @@ -40313,7 +41751,6 @@ "version": "7.5.9", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", - "dev": true, "requires": {} }, "xml-name-validator": { @@ -40328,6 +41765,15 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, + "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" + } + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 0efa8bd5b..8560ea29d 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,17 @@ "build": "react-scripts build", "test": "react-scripts test", "lint": "eslint .", - "prepare": "husky install" + "prepare": "husky install", + "update": "sh ./scripts/update-generated-files.sh" }, "engines": { "node": "^16.14.2", "npm": "^8.5.0" }, "dependencies": { + "@cosmjs/launchpad": "^0.27.1", + "@cosmjs/proto-signing": "^0.27.1", + "@cosmjs/stargate": "^0.27.1", "@floating-ui/react-dom": "^0.6.3", "@reach/dialog": "^0.17.0", "buffer": "^6.0.3", @@ -25,6 +29,11 @@ "react-router-dom": "^6.3.0", "web-vitals": "^2.1.4" }, + "peerDependencies": { + "crypto": "npm:crypto-browserify@^3.12.0", + "path": "npm:path-browserify@^1.0.1", + "stream": "npm:stream-browserify@3.0.0" + }, "devDependencies": { "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.3.0", diff --git a/scripts/update-generated-files.sh b/scripts/update-generated-files.sh new file mode 100644 index 000000000..8014bf401 --- /dev/null +++ b/scripts/update-generated-files.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# use provided source path or a default +DUALITY_CORE_DIRECTORY="${1:-"../duality"}" + +# copy type files +cp -r "$DUALITY_CORE_DIRECTORY/vue/src/store/generated/duality/duality.duality/module/types" \ + "src/lib/web3/generated/duality/duality.duality/module" + +# copy REST API file +cp -r "$DUALITY_CORE_DIRECTORY/vue/src/store/generated/duality/duality.duality/module/rest.ts" \ + "src/lib/web3/generated/duality/duality.duality/module/rest.ts" + +# copy version info +cp -r "$DUALITY_CORE_DIRECTORY/vue/src/store/generated/duality/duality.duality/package.json" \ + "src/lib/web3/generated/duality/duality.duality/package.json" + +# copy readme info +cp -r "$DUALITY_CORE_DIRECTORY/vue/src/store/generated/readme.md" \ + "src/lib/web3/generated/readme.md" diff --git a/src/lib/web3/api.ts b/src/lib/web3/api.ts new file mode 100755 index 000000000..f11e9cd62 --- /dev/null +++ b/src/lib/web3/api.ts @@ -0,0 +1,73 @@ +// This file is modified from an original generated/duality/duality.duality/module/index.ts file +// +// This file will not auto generate changes: +// if new Msgs are created they should be added to the txClient below + +import { StdFee } from '@cosmjs/launchpad'; +import { defaultRegistryTypes, SigningStargateClient } from '@cosmjs/stargate'; +import { Registry, OfflineSigner, EncodeObject } from '@cosmjs/proto-signing'; +import { + Api, + ApiConfig, +} from './generated/duality/duality.duality/module/rest'; +import { + MsgWithdrawShares, + MsgDepositShares, +} from './generated/duality/duality.duality/module/types/duality/tx'; + +const { REACT_APP__RPC_API = '', REACT_APP__REST_API = '' } = process.env; + +export const MissingWalletError = new Error('wallet is required'); + +export const registry = new Registry(defaultRegistryTypes); + +// -----> register our Msgs here +registry.register('/duality.duality.MsgDepositShares', MsgDepositShares); +registry.register('/duality.duality.MsgWithdrawShares', MsgWithdrawShares); + +interface TxClientOptions { + addr?: string; +} + +interface SignAndBroadcastOptions { + fee?: StdFee | 'auto' | number; + memo?: string; +} + +const txClient = async ( + wallet: OfflineSigner, + { addr = REACT_APP__RPC_API }: TxClientOptions = {} +) => { + if (!wallet) throw MissingWalletError; + const client = addr + ? await SigningStargateClient.connectWithSigner(addr, wallet, { registry }) + : await SigningStargateClient.offline(wallet, { registry }); + const { address } = (await wallet.getAccounts())[0]; + + return { + signAndBroadcast: ( + msgs: EncodeObject[], + { fee = 'auto', memo }: SignAndBroadcastOptions = {} + ) => client.signAndBroadcast(address, msgs, fee, memo), + + // -----> register our Msg client methods here + msgWithdrawShares: (data: MsgWithdrawShares): EncodeObject => ({ + typeUrl: '/duality.duality.MsgWithdrawShares', + value: MsgWithdrawShares.fromPartial(data), + }), + msgDepositShares: (data: MsgDepositShares): EncodeObject => ({ + typeUrl: '/duality.duality.MsgDepositShares', + value: MsgDepositShares.fromPartial(data), + }), + }; +}; + +const queryClient = async ({ + baseUrl = REACT_APP__REST_API, + baseApiParams, + securityWorker, +}: ApiConfig = {}) => { + return new Api({ baseUrl, baseApiParams, securityWorker }); +}; + +export { txClient, queryClient }; diff --git a/src/lib/web3/generated/duality/duality.duality/module/rest.ts b/src/lib/web3/generated/duality/duality.duality/module/rest.ts new file mode 100644 index 000000000..51c266c49 --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/rest.ts @@ -0,0 +1,544 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export type DualityMsgDepositSharesResponse = object; + +export type DualityMsgWithdrawSharesResponse = object; + +/** + * Params defines the parameters for the module. + */ +export type DualityParams = object; + +export interface DualityQueryAllShareResponse { + share?: DualityShare[]; + + /** + * 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; +} + +export interface DualityQueryAllTickResponse { + tick?: DualityTick[]; + + /** + * 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; +} + +export interface DualityQueryGetShareResponse { + share?: DualityShare; +} + +export interface DualityQueryGetTickResponse { + tick?: DualityTick; +} + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + */ +export interface DualityQueryParamsResponse { + /** params holds all the parameters of this module. */ + params?: DualityParams; +} + +export interface DualityShare { + owner?: string; + token0?: string; + token1?: string; + price0?: string; + price1?: string; + fee?: string; + shares0?: string; + shares1?: string; +} + +export interface DualityTick { + token0?: string; + token1?: string; + price0?: string; + price1?: string; + fee?: string; + reserves0?: string; + reserves1?: string; +} + +export interface ProtobufAny { + '@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; +} + +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< + FullRequestParams, + 'body' | 'method' | 'query' | 'path' +>; + +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 duality/genesis.proto + * @version version not set + */ +export class Api< + SecurityDataType extends unknown +> extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Parameters queries the parameters of the module. + * @request GET:/duality/duality/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/duality/duality/params`, + method: 'GET', + format: 'json', + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryShareAll + * @summary Queries a list of Share items. + * @request GET:/duality/duality/share + */ + queryShareAll = ( + query?: { + 'pagination.key'?: string; + 'pagination.offset'?: string; + 'pagination.limit'?: string; + 'pagination.count_total'?: boolean; + 'pagination.reverse'?: boolean; + }, + params: RequestParams = {} + ) => + this.request({ + path: `/duality/duality/share`, + method: 'GET', + query: query, + format: 'json', + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryShare + * @summary Queries a Share by index. + * @request GET:/duality/duality/share/{owner}/{token0}/{token1}/{price0}/{price1}/{fee} + */ + queryShare = ( + owner: string, + token0: string, + token1: string, + price0: string, + price1: string, + fee: string, + params: RequestParams = {} + ) => + this.request({ + path: `/duality/duality/share/${owner}/${token0}/${token1}/${price0}/${price1}/${fee}`, + method: 'GET', + format: 'json', + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryTickAll + * @summary Queries a list of Tick items. + * @request GET:/duality/duality/ticks + */ + queryTickAll = ( + query?: { + 'pagination.key'?: string; + 'pagination.offset'?: string; + 'pagination.limit'?: string; + 'pagination.count_total'?: boolean; + 'pagination.reverse'?: boolean; + token0?: string; + token1?: string; + fee?: string; + price0?: string; + price1?: string; + }, + params: RequestParams = {} + ) => + this.request({ + path: `/duality/duality/ticks`, + method: 'GET', + query: query, + format: 'json', + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryTickAllByTokens + * @summary Queries a list of Tick items by tokens. + * @request GET:/duality/duality/ticks/{token0}/{token1} + */ + queryTickAllByTokens = ( + token0: string, + token1: string, + query?: { + 'pagination.key'?: string; + 'pagination.offset'?: string; + 'pagination.limit'?: string; + 'pagination.count_total'?: boolean; + 'pagination.reverse'?: boolean; + fee?: string; + price0?: string; + price1?: string; + }, + params: RequestParams = {} + ) => + this.request({ + path: `/duality/duality/ticks/${token0}/${token1}`, + method: 'GET', + query: query, + format: 'json', + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryTick + * @summary Queries a Tick by index. + * @request GET:/duality/duality/ticks/{token0}/{token1}/{price0}/{price1}/{fee} + */ + queryTick = ( + token0: string, + token1: string, + price0: string, + price1: string, + fee: string, + params: RequestParams = {} + ) => + this.request({ + path: `/duality/duality/ticks/${token0}/${token1}/${price0}/${price1}/${fee}`, + method: 'GET', + format: 'json', + ...params, + }); +} diff --git a/src/lib/web3/generated/duality/duality.duality/module/types/cosmos/base/query/v1beta1/pagination.ts b/src/lib/web3/generated/duality/duality.duality/module/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 000000000..1341fc8a0 --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,328 @@ +/* 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/src/lib/web3/generated/duality/duality.duality/module/types/duality/genesis.ts b/src/lib/web3/generated/duality/duality.duality/module/types/duality/genesis.ts new file mode 100644 index 000000000..8cc170ac3 --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/duality/genesis.ts @@ -0,0 +1,134 @@ +/* eslint-disable */ +import { Params } from '../duality/params'; +import { Share } from '../duality/share'; +import { Tick } from '../duality/tick'; +import { Writer, Reader } from 'protobufjs/minimal'; + +export const protobufPackage = 'duality.duality'; + +/** GenesisState defines the duality module's genesis state. */ +export interface GenesisState { + params: Params | undefined; + shareList: Share[]; + /** this line is used by starport scaffolding # genesis/proto/state */ + tickList: Tick[]; +} + +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.shareList) { + Share.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.tickList) { + Tick.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.shareList = []; + message.tickList = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.shareList.push(Share.decode(reader, reader.uint32())); + break; + case 3: + message.tickList.push(Tick.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.shareList = []; + message.tickList = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + if (object.shareList !== undefined && object.shareList !== null) { + for (const e of object.shareList) { + message.shareList.push(Share.fromJSON(e)); + } + } + if (object.tickList !== undefined && object.tickList !== null) { + for (const e of object.tickList) { + message.tickList.push(Tick.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.shareList) { + obj.shareList = message.shareList.map((e) => + e ? Share.toJSON(e) : undefined + ); + } else { + obj.shareList = []; + } + if (message.tickList) { + obj.tickList = message.tickList.map((e) => + e ? Tick.toJSON(e) : undefined + ); + } else { + obj.tickList = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.shareList = []; + message.tickList = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + if (object.shareList !== undefined && object.shareList !== null) { + for (const e of object.shareList) { + message.shareList.push(Share.fromPartial(e)); + } + } + if (object.tickList !== undefined && object.tickList !== null) { + for (const e of object.tickList) { + message.tickList.push(Tick.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/src/lib/web3/generated/duality/duality.duality/module/types/duality/params.ts b/src/lib/web3/generated/duality/duality.duality/module/types/duality/params.ts new file mode 100644 index 000000000..584d5107f --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/duality/params.ts @@ -0,0 +1,56 @@ +/* eslint-disable */ +import { Writer, Reader } from 'protobufjs/minimal'; + +export const protobufPackage = 'duality.duality'; + +/** Params defines the parameters for the module. */ +export interface Params {} + +const baseParams: object = {}; + +export const Params = { + encode(_: Params, writer: Writer = Writer.create()): Writer { + 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) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): Params { + const message = { ...baseParams } as Params; + return message; + }, + + toJSON(_: Params): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): Params { + const message = { ...baseParams } as Params; + 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/src/lib/web3/generated/duality/duality.duality/module/types/duality/query.ts b/src/lib/web3/generated/duality/duality.duality/module/types/duality/query.ts new file mode 100644 index 000000000..417d212be --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/duality/query.ts @@ -0,0 +1,1235 @@ +/* eslint-disable */ +import { Reader, Writer } from 'protobufjs/minimal'; +import { Params } from '../duality/params'; +import { Share } from '../duality/share'; +import { + PageRequest, + PageResponse, +} from '../cosmos/base/query/v1beta1/pagination'; +import { Tick } from '../duality/tick'; + +export const protobufPackage = 'duality.duality'; + +/** 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; +} + +export interface QueryGetShareRequest { + owner: string; + token0: string; + token1: string; + price0: string; + price1: string; + fee: string; +} + +export interface QueryGetShareResponse { + share: Share | undefined; +} + +export interface QueryAllShareRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllShareResponse { + share: Share[]; + pagination: PageResponse | undefined; +} + +export interface QueryGetTickRequest { + token0: string; + token1: string; + price0: string; + price1: string; + fee: string; +} + +export interface QueryGetTickResponse { + tick: Tick | undefined; +} + +export interface QueryAllTickByTokensRequest { + token0: string; + token1: string; + /** optional added query parameters below */ + pagination: PageRequest | undefined; + /** filter to fee */ + fee: string; + /** filter to price of token0 */ + price0: string; + /** filter to price of token1 */ + price1: string; +} + +export interface QueryAllTickRequest { + /** optional added query parameters below */ + pagination: PageRequest | undefined; + /** filter to token */ + token0: string; + /** filter to token */ + token1: string; + /** filter to fee */ + fee: string; + /** filter to price of token0 */ + price0: string; + /** filter to price of token1 */ + price1: string; +} + +export interface QueryAllTickResponse { + tick: Tick[]; + 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 baseQueryGetShareRequest: object = { + owner: '', + token0: '', + token1: '', + price0: '', + price1: '', + fee: '', +}; + +export const QueryGetShareRequest = { + encode( + message: QueryGetShareRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.token0 !== '') { + writer.uint32(18).string(message.token0); + } + if (message.token1 !== '') { + writer.uint32(26).string(message.token1); + } + if (message.price0 !== '') { + writer.uint32(34).string(message.price0); + } + if (message.price1 !== '') { + writer.uint32(42).string(message.price1); + } + if (message.fee !== '') { + writer.uint32(50).string(message.fee); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryGetShareRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryGetShareRequest } as QueryGetShareRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.token0 = reader.string(); + break; + case 3: + message.token1 = reader.string(); + break; + case 4: + message.price0 = reader.string(); + break; + case 5: + message.price1 = reader.string(); + break; + case 6: + message.fee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetShareRequest { + const message = { ...baseQueryGetShareRequest } as QueryGetShareRequest; + if (object.owner !== undefined && object.owner !== null) { + message.owner = String(object.owner); + } else { + message.owner = ''; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = String(object.token0); + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = String(object.token1); + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = String(object.price0); + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = String(object.price1); + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = String(object.fee); + } else { + message.fee = ''; + } + return message; + }, + + toJSON(message: QueryGetShareRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.token0 !== undefined && (obj.token0 = message.token0); + message.token1 !== undefined && (obj.token1 = message.token1); + message.price0 !== undefined && (obj.price0 = message.price0); + message.price1 !== undefined && (obj.price1 = message.price1); + message.fee !== undefined && (obj.fee = message.fee); + return obj; + }, + + fromPartial(object: DeepPartial): QueryGetShareRequest { + const message = { ...baseQueryGetShareRequest } as QueryGetShareRequest; + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } else { + message.owner = ''; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = object.price0; + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = object.price1; + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } else { + message.fee = ''; + } + return message; + }, +}; + +const baseQueryGetShareResponse: object = {}; + +export const QueryGetShareResponse = { + encode( + message: QueryGetShareResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.share !== undefined) { + Share.encode(message.share, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryGetShareResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryGetShareResponse } as QueryGetShareResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.share = Share.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetShareResponse { + const message = { ...baseQueryGetShareResponse } as QueryGetShareResponse; + if (object.share !== undefined && object.share !== null) { + message.share = Share.fromJSON(object.share); + } else { + message.share = undefined; + } + return message; + }, + + toJSON(message: QueryGetShareResponse): unknown { + const obj: any = {}; + message.share !== undefined && + (obj.share = message.share ? Share.toJSON(message.share) : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryGetShareResponse { + const message = { ...baseQueryGetShareResponse } as QueryGetShareResponse; + if (object.share !== undefined && object.share !== null) { + message.share = Share.fromPartial(object.share); + } else { + message.share = undefined; + } + return message; + }, +}; + +const baseQueryAllShareRequest: object = {}; + +export const QueryAllShareRequest = { + encode( + message: QueryAllShareRequest, + 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): QueryAllShareRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllShareRequest } as QueryAllShareRequest; + 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): QueryAllShareRequest { + const message = { ...baseQueryAllShareRequest } as QueryAllShareRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllShareRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAllShareRequest { + const message = { ...baseQueryAllShareRequest } as QueryAllShareRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllShareResponse: object = {}; + +export const QueryAllShareResponse = { + encode( + message: QueryAllShareResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.share) { + Share.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): QueryAllShareResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllShareResponse } as QueryAllShareResponse; + message.share = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.share.push(Share.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): QueryAllShareResponse { + const message = { ...baseQueryAllShareResponse } as QueryAllShareResponse; + message.share = []; + if (object.share !== undefined && object.share !== null) { + for (const e of object.share) { + message.share.push(Share.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllShareResponse): unknown { + const obj: any = {}; + if (message.share) { + obj.share = message.share.map((e) => (e ? Share.toJSON(e) : undefined)); + } else { + obj.share = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllShareResponse { + const message = { ...baseQueryAllShareResponse } as QueryAllShareResponse; + message.share = []; + if (object.share !== undefined && object.share !== null) { + for (const e of object.share) { + message.share.push(Share.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryGetTickRequest: object = { + token0: '', + token1: '', + price0: '', + price1: '', + fee: '', +}; + +export const QueryGetTickRequest = { + encode( + message: QueryGetTickRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.token0 !== '') { + writer.uint32(10).string(message.token0); + } + if (message.token1 !== '') { + writer.uint32(18).string(message.token1); + } + if (message.price0 !== '') { + writer.uint32(26).string(message.price0); + } + if (message.price1 !== '') { + writer.uint32(34).string(message.price1); + } + if (message.fee !== '') { + writer.uint32(42).string(message.fee); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryGetTickRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryGetTickRequest } as QueryGetTickRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.token0 = reader.string(); + break; + case 2: + message.token1 = reader.string(); + break; + case 3: + message.price0 = reader.string(); + break; + case 4: + message.price1 = reader.string(); + break; + case 5: + message.fee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetTickRequest { + const message = { ...baseQueryGetTickRequest } as QueryGetTickRequest; + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = String(object.token0); + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = String(object.token1); + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = String(object.price0); + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = String(object.price1); + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = String(object.fee); + } else { + message.fee = ''; + } + return message; + }, + + toJSON(message: QueryGetTickRequest): unknown { + const obj: any = {}; + message.token0 !== undefined && (obj.token0 = message.token0); + message.token1 !== undefined && (obj.token1 = message.token1); + message.price0 !== undefined && (obj.price0 = message.price0); + message.price1 !== undefined && (obj.price1 = message.price1); + message.fee !== undefined && (obj.fee = message.fee); + return obj; + }, + + fromPartial(object: DeepPartial): QueryGetTickRequest { + const message = { ...baseQueryGetTickRequest } as QueryGetTickRequest; + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = object.price0; + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = object.price1; + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } else { + message.fee = ''; + } + return message; + }, +}; + +const baseQueryGetTickResponse: object = {}; + +export const QueryGetTickResponse = { + encode( + message: QueryGetTickResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.tick !== undefined) { + Tick.encode(message.tick, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryGetTickResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryGetTickResponse } as QueryGetTickResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tick = Tick.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetTickResponse { + const message = { ...baseQueryGetTickResponse } as QueryGetTickResponse; + if (object.tick !== undefined && object.tick !== null) { + message.tick = Tick.fromJSON(object.tick); + } else { + message.tick = undefined; + } + return message; + }, + + toJSON(message: QueryGetTickResponse): unknown { + const obj: any = {}; + message.tick !== undefined && + (obj.tick = message.tick ? Tick.toJSON(message.tick) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryGetTickResponse { + const message = { ...baseQueryGetTickResponse } as QueryGetTickResponse; + if (object.tick !== undefined && object.tick !== null) { + message.tick = Tick.fromPartial(object.tick); + } else { + message.tick = undefined; + } + return message; + }, +}; + +const baseQueryAllTickByTokensRequest: object = { + token0: '', + token1: '', + fee: '', + price0: '', + price1: '', +}; + +export const QueryAllTickByTokensRequest = { + encode( + message: QueryAllTickByTokensRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.token0 !== '') { + writer.uint32(10).string(message.token0); + } + if (message.token1 !== '') { + writer.uint32(18).string(message.token1); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + if (message.fee !== '') { + writer.uint32(34).string(message.fee); + } + if (message.price0 !== '') { + writer.uint32(42).string(message.price0); + } + if (message.price1 !== '') { + writer.uint32(50).string(message.price1); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllTickByTokensRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllTickByTokensRequest, + } as QueryAllTickByTokensRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.token0 = reader.string(); + break; + case 2: + message.token1 = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + case 4: + message.fee = reader.string(); + break; + case 5: + message.price0 = reader.string(); + break; + case 6: + message.price1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllTickByTokensRequest { + const message = { + ...baseQueryAllTickByTokensRequest, + } as QueryAllTickByTokensRequest; + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = String(object.token0); + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = String(object.token1); + } else { + message.token1 = ''; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = String(object.fee); + } else { + message.fee = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = String(object.price0); + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = String(object.price1); + } else { + message.price1 = ''; + } + return message; + }, + + toJSON(message: QueryAllTickByTokensRequest): unknown { + const obj: any = {}; + message.token0 !== undefined && (obj.token0 = message.token0); + message.token1 !== undefined && (obj.token1 = message.token1); + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + message.fee !== undefined && (obj.fee = message.fee); + message.price0 !== undefined && (obj.price0 = message.price0); + message.price1 !== undefined && (obj.price1 = message.price1); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllTickByTokensRequest { + const message = { + ...baseQueryAllTickByTokensRequest, + } as QueryAllTickByTokensRequest; + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } else { + message.token1 = ''; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } else { + message.fee = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = object.price0; + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = object.price1; + } else { + message.price1 = ''; + } + return message; + }, +}; + +const baseQueryAllTickRequest: object = { + token0: '', + token1: '', + fee: '', + price0: '', + price1: '', +}; + +export const QueryAllTickRequest = { + encode( + message: QueryAllTickRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + if (message.token0 !== '') { + writer.uint32(18).string(message.token0); + } + if (message.token1 !== '') { + writer.uint32(26).string(message.token1); + } + if (message.fee !== '') { + writer.uint32(34).string(message.fee); + } + if (message.price0 !== '') { + writer.uint32(42).string(message.price0); + } + if (message.price1 !== '') { + writer.uint32(50).string(message.price1); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryAllTickRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllTickRequest } as QueryAllTickRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + case 2: + message.token0 = reader.string(); + break; + case 3: + message.token1 = reader.string(); + break; + case 4: + message.fee = reader.string(); + break; + case 5: + message.price0 = reader.string(); + break; + case 6: + message.price1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllTickRequest { + const message = { ...baseQueryAllTickRequest } as QueryAllTickRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = String(object.token0); + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = String(object.token1); + } else { + message.token1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = String(object.fee); + } else { + message.fee = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = String(object.price0); + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = String(object.price1); + } else { + message.price1 = ''; + } + return message; + }, + + toJSON(message: QueryAllTickRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + message.token0 !== undefined && (obj.token0 = message.token0); + message.token1 !== undefined && (obj.token1 = message.token1); + message.fee !== undefined && (obj.fee = message.fee); + message.price0 !== undefined && (obj.price0 = message.price0); + message.price1 !== undefined && (obj.price1 = message.price1); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAllTickRequest { + const message = { ...baseQueryAllTickRequest } as QueryAllTickRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } else { + message.token1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } else { + message.fee = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = object.price0; + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = object.price1; + } else { + message.price1 = ''; + } + return message; + }, +}; + +const baseQueryAllTickResponse: object = {}; + +export const QueryAllTickResponse = { + encode( + message: QueryAllTickResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.tick) { + Tick.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): QueryAllTickResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllTickResponse } as QueryAllTickResponse; + message.tick = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tick.push(Tick.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): QueryAllTickResponse { + const message = { ...baseQueryAllTickResponse } as QueryAllTickResponse; + message.tick = []; + if (object.tick !== undefined && object.tick !== null) { + for (const e of object.tick) { + message.tick.push(Tick.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllTickResponse): unknown { + const obj: any = {}; + if (message.tick) { + obj.tick = message.tick.map((e) => (e ? Tick.toJSON(e) : undefined)); + } else { + obj.tick = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAllTickResponse { + const message = { ...baseQueryAllTickResponse } as QueryAllTickResponse; + message.tick = []; + if (object.tick !== undefined && object.tick !== null) { + for (const e of object.tick) { + message.tick.push(Tick.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 { + /** Parameters queries the parameters of the module. */ + Params(request: QueryParamsRequest): Promise; + /** Queries a Share by index. */ + Share(request: QueryGetShareRequest): Promise; + /** Queries a list of Share items. */ + ShareAll(request: QueryAllShareRequest): Promise; + /** Queries a Tick by index. */ + Tick(request: QueryGetTickRequest): Promise; + /** Queries a list of Tick items by tokens. */ + TickAllByTokens( + request: QueryAllTickByTokensRequest + ): Promise; + /** Queries a list of Tick items. */ + TickAll(request: QueryAllTickRequest): 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('duality.duality.Query', 'Params', data); + return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + } + + Share(request: QueryGetShareRequest): Promise { + const data = QueryGetShareRequest.encode(request).finish(); + const promise = this.rpc.request('duality.duality.Query', 'Share', data); + return promise.then((data) => + QueryGetShareResponse.decode(new Reader(data)) + ); + } + + ShareAll(request: QueryAllShareRequest): Promise { + const data = QueryAllShareRequest.encode(request).finish(); + const promise = this.rpc.request('duality.duality.Query', 'ShareAll', data); + return promise.then((data) => + QueryAllShareResponse.decode(new Reader(data)) + ); + } + + Tick(request: QueryGetTickRequest): Promise { + const data = QueryGetTickRequest.encode(request).finish(); + const promise = this.rpc.request('duality.duality.Query', 'Tick', data); + return promise.then((data) => + QueryGetTickResponse.decode(new Reader(data)) + ); + } + + TickAllByTokens( + request: QueryAllTickByTokensRequest + ): Promise { + const data = QueryAllTickByTokensRequest.encode(request).finish(); + const promise = this.rpc.request( + 'duality.duality.Query', + 'TickAllByTokens', + data + ); + return promise.then((data) => + QueryAllTickResponse.decode(new Reader(data)) + ); + } + + TickAll(request: QueryAllTickRequest): Promise { + const data = QueryAllTickRequest.encode(request).finish(); + const promise = this.rpc.request('duality.duality.Query', 'TickAll', data); + return promise.then((data) => + QueryAllTickResponse.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/src/lib/web3/generated/duality/duality.duality/module/types/duality/share.ts b/src/lib/web3/generated/duality/duality.duality/module/types/duality/share.ts new file mode 100644 index 000000000..79a21d943 --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/duality/share.ts @@ -0,0 +1,209 @@ +/* eslint-disable */ +import { Writer, Reader } from 'protobufjs/minimal'; + +export const protobufPackage = 'duality.duality'; + +export interface Share { + owner: string; + token0: string; + token1: string; + price0: string; + price1: string; + fee: string; + shares0: string; + shares1: string; +} + +const baseShare: object = { + owner: '', + token0: '', + token1: '', + price0: '', + price1: '', + fee: '', + shares0: '', + shares1: '', +}; + +export const Share = { + encode(message: Share, writer: Writer = Writer.create()): Writer { + if (message.owner !== '') { + writer.uint32(10).string(message.owner); + } + if (message.token0 !== '') { + writer.uint32(18).string(message.token0); + } + if (message.token1 !== '') { + writer.uint32(26).string(message.token1); + } + if (message.price0 !== '') { + writer.uint32(34).string(message.price0); + } + if (message.price1 !== '') { + writer.uint32(42).string(message.price1); + } + if (message.fee !== '') { + writer.uint32(50).string(message.fee); + } + if (message.shares0 !== '') { + writer.uint32(58).string(message.shares0); + } + if (message.shares1 !== '') { + writer.uint32(66).string(message.shares1); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Share { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseShare } as Share; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.token0 = reader.string(); + break; + case 3: + message.token1 = reader.string(); + break; + case 4: + message.price0 = reader.string(); + break; + case 5: + message.price1 = reader.string(); + break; + case 6: + message.fee = reader.string(); + break; + case 7: + message.shares0 = reader.string(); + break; + case 8: + message.shares1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Share { + const message = { ...baseShare } as Share; + if (object.owner !== undefined && object.owner !== null) { + message.owner = String(object.owner); + } else { + message.owner = ''; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = String(object.token0); + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = String(object.token1); + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = String(object.price0); + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = String(object.price1); + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = String(object.fee); + } else { + message.fee = ''; + } + if (object.shares0 !== undefined && object.shares0 !== null) { + message.shares0 = String(object.shares0); + } else { + message.shares0 = ''; + } + if (object.shares1 !== undefined && object.shares1 !== null) { + message.shares1 = String(object.shares1); + } else { + message.shares1 = ''; + } + return message; + }, + + toJSON(message: Share): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.token0 !== undefined && (obj.token0 = message.token0); + message.token1 !== undefined && (obj.token1 = message.token1); + message.price0 !== undefined && (obj.price0 = message.price0); + message.price1 !== undefined && (obj.price1 = message.price1); + message.fee !== undefined && (obj.fee = message.fee); + message.shares0 !== undefined && (obj.shares0 = message.shares0); + message.shares1 !== undefined && (obj.shares1 = message.shares1); + return obj; + }, + + fromPartial(object: DeepPartial): Share { + const message = { ...baseShare } as Share; + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } else { + message.owner = ''; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = object.price0; + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = object.price1; + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } else { + message.fee = ''; + } + if (object.shares0 !== undefined && object.shares0 !== null) { + message.shares0 = object.shares0; + } else { + message.shares0 = ''; + } + if (object.shares1 !== undefined && object.shares1 !== null) { + message.shares1 = object.shares1; + } else { + message.shares1 = ''; + } + 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/src/lib/web3/generated/duality/duality.duality/module/types/duality/tick.ts b/src/lib/web3/generated/duality/duality.duality/module/types/duality/tick.ts new file mode 100644 index 000000000..8f4b0ac8d --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/duality/tick.ts @@ -0,0 +1,190 @@ +/* eslint-disable */ +import { Writer, Reader } from 'protobufjs/minimal'; + +export const protobufPackage = 'duality.duality'; + +export interface Tick { + token0: string; + token1: string; + price0: string; + price1: string; + fee: string; + reserves0: string; + reserves1: string; +} + +const baseTick: object = { + token0: '', + token1: '', + price0: '', + price1: '', + fee: '', + reserves0: '', + reserves1: '', +}; + +export const Tick = { + encode(message: Tick, writer: Writer = Writer.create()): Writer { + if (message.token0 !== '') { + writer.uint32(10).string(message.token0); + } + if (message.token1 !== '') { + writer.uint32(18).string(message.token1); + } + if (message.price0 !== '') { + writer.uint32(26).string(message.price0); + } + if (message.price1 !== '') { + writer.uint32(34).string(message.price1); + } + if (message.fee !== '') { + writer.uint32(42).string(message.fee); + } + if (message.reserves0 !== '') { + writer.uint32(50).string(message.reserves0); + } + if (message.reserves1 !== '') { + writer.uint32(58).string(message.reserves1); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Tick { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTick } as Tick; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.token0 = reader.string(); + break; + case 2: + message.token1 = reader.string(); + break; + case 3: + message.price0 = reader.string(); + break; + case 4: + message.price1 = reader.string(); + break; + case 5: + message.fee = reader.string(); + break; + case 6: + message.reserves0 = reader.string(); + break; + case 7: + message.reserves1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Tick { + const message = { ...baseTick } as Tick; + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = String(object.token0); + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = String(object.token1); + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = String(object.price0); + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = String(object.price1); + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = String(object.fee); + } else { + message.fee = ''; + } + if (object.reserves0 !== undefined && object.reserves0 !== null) { + message.reserves0 = String(object.reserves0); + } else { + message.reserves0 = ''; + } + if (object.reserves1 !== undefined && object.reserves1 !== null) { + message.reserves1 = String(object.reserves1); + } else { + message.reserves1 = ''; + } + return message; + }, + + toJSON(message: Tick): unknown { + const obj: any = {}; + message.token0 !== undefined && (obj.token0 = message.token0); + message.token1 !== undefined && (obj.token1 = message.token1); + message.price0 !== undefined && (obj.price0 = message.price0); + message.price1 !== undefined && (obj.price1 = message.price1); + message.fee !== undefined && (obj.fee = message.fee); + message.reserves0 !== undefined && (obj.reserves0 = message.reserves0); + message.reserves1 !== undefined && (obj.reserves1 = message.reserves1); + return obj; + }, + + fromPartial(object: DeepPartial): Tick { + const message = { ...baseTick } as Tick; + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = object.price0; + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = object.price1; + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } else { + message.fee = ''; + } + if (object.reserves0 !== undefined && object.reserves0 !== null) { + message.reserves0 = object.reserves0; + } else { + message.reserves0 = ''; + } + if (object.reserves1 !== undefined && object.reserves1 !== null) { + message.reserves1 = object.reserves1; + } else { + message.reserves1 = ''; + } + 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/src/lib/web3/generated/duality/duality.duality/module/types/duality/tx.ts b/src/lib/web3/generated/duality/duality.duality/module/types/duality/tx.ts new file mode 100644 index 000000000..25584f91b --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/duality/tx.ts @@ -0,0 +1,560 @@ +/* eslint-disable */ +import { Reader, Writer } from 'protobufjs/minimal'; + +export const protobufPackage = 'duality.duality'; + +export interface MsgDepositShares { + creator: string; + token0: string; + token1: string; + price0: string; + price1: string; + fee: string; + shares0: string; + shares1: string; +} + +export interface MsgDepositSharesResponse {} + +export interface MsgWithdrawShares { + creator: string; + token0: string; + token1: string; + price0: string; + price1: string; + fee: string; + shares0: string; + shares1: string; +} + +export interface MsgWithdrawSharesResponse {} + +const baseMsgDepositShares: object = { + creator: '', + token0: '', + token1: '', + price0: '', + price1: '', + fee: '', + shares0: '', + shares1: '', +}; + +export const MsgDepositShares = { + encode(message: MsgDepositShares, writer: Writer = Writer.create()): Writer { + if (message.creator !== '') { + writer.uint32(10).string(message.creator); + } + if (message.token0 !== '') { + writer.uint32(18).string(message.token0); + } + if (message.token1 !== '') { + writer.uint32(26).string(message.token1); + } + if (message.price0 !== '') { + writer.uint32(34).string(message.price0); + } + if (message.price1 !== '') { + writer.uint32(42).string(message.price1); + } + if (message.fee !== '') { + writer.uint32(50).string(message.fee); + } + if (message.shares0 !== '') { + writer.uint32(58).string(message.shares0); + } + if (message.shares1 !== '') { + writer.uint32(66).string(message.shares1); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgDepositShares { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgDepositShares } as MsgDepositShares; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.token0 = reader.string(); + break; + case 3: + message.token1 = reader.string(); + break; + case 4: + message.price0 = reader.string(); + break; + case 5: + message.price1 = reader.string(); + break; + case 6: + message.fee = reader.string(); + break; + case 7: + message.shares0 = reader.string(); + break; + case 8: + message.shares1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgDepositShares { + const message = { ...baseMsgDepositShares } as MsgDepositShares; + if (object.creator !== undefined && object.creator !== null) { + message.creator = String(object.creator); + } else { + message.creator = ''; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = String(object.token0); + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = String(object.token1); + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = String(object.price0); + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = String(object.price1); + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = String(object.fee); + } else { + message.fee = ''; + } + if (object.shares0 !== undefined && object.shares0 !== null) { + message.shares0 = String(object.shares0); + } else { + message.shares0 = ''; + } + if (object.shares1 !== undefined && object.shares1 !== null) { + message.shares1 = String(object.shares1); + } else { + message.shares1 = ''; + } + return message; + }, + + toJSON(message: MsgDepositShares): unknown { + const obj: any = {}; + message.creator !== undefined && (obj.creator = message.creator); + message.token0 !== undefined && (obj.token0 = message.token0); + message.token1 !== undefined && (obj.token1 = message.token1); + message.price0 !== undefined && (obj.price0 = message.price0); + message.price1 !== undefined && (obj.price1 = message.price1); + message.fee !== undefined && (obj.fee = message.fee); + message.shares0 !== undefined && (obj.shares0 = message.shares0); + message.shares1 !== undefined && (obj.shares1 = message.shares1); + return obj; + }, + + fromPartial(object: DeepPartial): MsgDepositShares { + const message = { ...baseMsgDepositShares } as MsgDepositShares; + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } else { + message.creator = ''; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = object.price0; + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = object.price1; + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } else { + message.fee = ''; + } + if (object.shares0 !== undefined && object.shares0 !== null) { + message.shares0 = object.shares0; + } else { + message.shares0 = ''; + } + if (object.shares1 !== undefined && object.shares1 !== null) { + message.shares1 = object.shares1; + } else { + message.shares1 = ''; + } + return message; + }, +}; + +const baseMsgDepositSharesResponse: object = {}; + +export const MsgDepositSharesResponse = { + encode( + _: MsgDepositSharesResponse, + writer: Writer = Writer.create() + ): Writer { + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): MsgDepositSharesResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMsgDepositSharesResponse, + } as MsgDepositSharesResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgDepositSharesResponse { + const message = { + ...baseMsgDepositSharesResponse, + } as MsgDepositSharesResponse; + return message; + }, + + toJSON(_: MsgDepositSharesResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial( + _: DeepPartial + ): MsgDepositSharesResponse { + const message = { + ...baseMsgDepositSharesResponse, + } as MsgDepositSharesResponse; + return message; + }, +}; + +const baseMsgWithdrawShares: object = { + creator: '', + token0: '', + token1: '', + price0: '', + price1: '', + fee: '', + shares0: '', + shares1: '', +}; + +export const MsgWithdrawShares = { + encode(message: MsgWithdrawShares, writer: Writer = Writer.create()): Writer { + if (message.creator !== '') { + writer.uint32(10).string(message.creator); + } + if (message.token0 !== '') { + writer.uint32(18).string(message.token0); + } + if (message.token1 !== '') { + writer.uint32(26).string(message.token1); + } + if (message.price0 !== '') { + writer.uint32(34).string(message.price0); + } + if (message.price1 !== '') { + writer.uint32(42).string(message.price1); + } + if (message.fee !== '') { + writer.uint32(50).string(message.fee); + } + if (message.shares0 !== '') { + writer.uint32(58).string(message.shares0); + } + if (message.shares1 !== '') { + writer.uint32(66).string(message.shares1); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgWithdrawShares { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgWithdrawShares } as MsgWithdrawShares; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.token0 = reader.string(); + break; + case 3: + message.token1 = reader.string(); + break; + case 4: + message.price0 = reader.string(); + break; + case 5: + message.price1 = reader.string(); + break; + case 6: + message.fee = reader.string(); + break; + case 7: + message.shares0 = reader.string(); + break; + case 8: + message.shares1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgWithdrawShares { + const message = { ...baseMsgWithdrawShares } as MsgWithdrawShares; + if (object.creator !== undefined && object.creator !== null) { + message.creator = String(object.creator); + } else { + message.creator = ''; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = String(object.token0); + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = String(object.token1); + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = String(object.price0); + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = String(object.price1); + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = String(object.fee); + } else { + message.fee = ''; + } + if (object.shares0 !== undefined && object.shares0 !== null) { + message.shares0 = String(object.shares0); + } else { + message.shares0 = ''; + } + if (object.shares1 !== undefined && object.shares1 !== null) { + message.shares1 = String(object.shares1); + } else { + message.shares1 = ''; + } + return message; + }, + + toJSON(message: MsgWithdrawShares): unknown { + const obj: any = {}; + message.creator !== undefined && (obj.creator = message.creator); + message.token0 !== undefined && (obj.token0 = message.token0); + message.token1 !== undefined && (obj.token1 = message.token1); + message.price0 !== undefined && (obj.price0 = message.price0); + message.price1 !== undefined && (obj.price1 = message.price1); + message.fee !== undefined && (obj.fee = message.fee); + message.shares0 !== undefined && (obj.shares0 = message.shares0); + message.shares1 !== undefined && (obj.shares1 = message.shares1); + return obj; + }, + + fromPartial(object: DeepPartial): MsgWithdrawShares { + const message = { ...baseMsgWithdrawShares } as MsgWithdrawShares; + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } else { + message.creator = ''; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } else { + message.token0 = ''; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } else { + message.token1 = ''; + } + if (object.price0 !== undefined && object.price0 !== null) { + message.price0 = object.price0; + } else { + message.price0 = ''; + } + if (object.price1 !== undefined && object.price1 !== null) { + message.price1 = object.price1; + } else { + message.price1 = ''; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } else { + message.fee = ''; + } + if (object.shares0 !== undefined && object.shares0 !== null) { + message.shares0 = object.shares0; + } else { + message.shares0 = ''; + } + if (object.shares1 !== undefined && object.shares1 !== null) { + message.shares1 = object.shares1; + } else { + message.shares1 = ''; + } + return message; + }, +}; + +const baseMsgWithdrawSharesResponse: object = {}; + +export const MsgWithdrawSharesResponse = { + encode( + _: MsgWithdrawSharesResponse, + writer: Writer = Writer.create() + ): Writer { + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): MsgWithdrawSharesResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMsgWithdrawSharesResponse, + } as MsgWithdrawSharesResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgWithdrawSharesResponse { + const message = { + ...baseMsgWithdrawSharesResponse, + } as MsgWithdrawSharesResponse; + return message; + }, + + toJSON(_: MsgWithdrawSharesResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial( + _: DeepPartial + ): MsgWithdrawSharesResponse { + const message = { + ...baseMsgWithdrawSharesResponse, + } as MsgWithdrawSharesResponse; + return message; + }, +}; + +/** Msg defines the Msg service. */ +export interface Msg { + DepositShares(request: MsgDepositShares): Promise; + /** this line is used by starport scaffolding # proto/tx/rpc */ + WithdrawShares( + request: MsgWithdrawShares + ): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + DepositShares(request: MsgDepositShares): Promise { + const data = MsgDepositShares.encode(request).finish(); + const promise = this.rpc.request( + 'duality.duality.Msg', + 'DepositShares', + data + ); + return promise.then((data) => + MsgDepositSharesResponse.decode(new Reader(data)) + ); + } + + WithdrawShares( + request: MsgWithdrawShares + ): Promise { + const data = MsgWithdrawShares.encode(request).finish(); + const promise = this.rpc.request( + 'duality.duality.Msg', + 'WithdrawShares', + data + ); + return promise.then((data) => + MsgWithdrawSharesResponse.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/src/lib/web3/generated/duality/duality.duality/module/types/gogoproto/gogo.ts b/src/lib/web3/generated/duality/duality.duality/module/types/gogoproto/gogo.ts new file mode 100644 index 000000000..f02f645e5 --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/gogoproto/gogo.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = 'gogoproto'; diff --git a/src/lib/web3/generated/duality/duality.duality/module/types/google/api/annotations.ts b/src/lib/web3/generated/duality/duality.duality/module/types/google/api/annotations.ts new file mode 100644 index 000000000..e7afb6fec --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/google/api/annotations.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = 'google.api'; diff --git a/src/lib/web3/generated/duality/duality.duality/module/types/google/api/http.ts b/src/lib/web3/generated/duality/duality.duality/module/types/google/api/http.ts new file mode 100644 index 000000000..cd07f91db --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/google/api/http.ts @@ -0,0 +1,706 @@ +/* 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/src/lib/web3/generated/duality/duality.duality/module/types/google/protobuf/descriptor.ts b/src/lib/web3/generated/duality/duality.duality/module/types/google/protobuf/descriptor.ts new file mode 100644 index 000000000..9f7e9442b --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/module/types/google/protobuf/descriptor.ts @@ -0,0 +1,5314 @@ +/* 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/src/lib/web3/generated/duality/duality.duality/package.json b/src/lib/web3/generated/duality/duality.duality/package.json new file mode 100755 index 000000000..41279ac44 --- /dev/null +++ b/src/lib/web3/generated/duality/duality.duality/package.json @@ -0,0 +1,18 @@ +{ + "name": "duality-duality-js", + "version": "0.1.0", + "description": "Autogenerated vuex store for Cosmos module duality.duality", + "author": "Starport Codegen ", + "homepage": "http://duality/x/duality/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" + } +} diff --git a/src/lib/web3/generated/readme.md b/src/lib/web3/generated/readme.md new file mode 100644 index 000000000..a9a292f4b --- /dev/null +++ b/src/lib/web3/generated/readme.md @@ -0,0 +1 @@ +THIS FOLDER IS GENERATED AUTOMATICALLY. DO NOT MODIFY. diff --git a/tsconfig.json b/tsconfig.json index 9d379a3c4..8e42d8f26 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,5 +16,6 @@ "noEmit": true, "jsx": "react-jsx" }, - "include": ["src"] + "include": ["src"], + "exclude": ["src/lib/web3/generated"] }